home *** CD-ROM | disk | FTP | other *** search
/ Master Hacker / Master_Hacker_Internet_and_Computer_Security_and_Terrorism_Core_Publishing_Group_2001.iso / e-zines / infinity concept.txt < prev    next >
Text File  |  2000-01-15  |  132KB  |  3,360 lines

  1.  
  2.  
  3.  
  4.  
  5.             T H E  I N F I N I T Y   C O N C E P T
  6.                    ```   ```
  7.                   `   ``    `
  8.                    ```   ```
  9.  
  10.  
  11.  
  12.                   .oO____Oo.
  13.  
  14.  
  15. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~The Infinity Concept~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  16.                  . Issue #1 .
  17.                    . Summer  1995 .
  18.         
  19. -=-=-=-=-=-=-=-=-=Brought to you by the members and associates of-=-=-=-=-=-=
  20.  
  21. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-the Guild=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-  
  22.     
  23.             .Route [daemon9/Infinity].
  24.             .......Nihil..............
  25.             .......Carbonboy..........  
  26.             .......Squidge............
  27.             .......jfp................
  28.             .......E-fx...............
  29.             .......Mythrandir.........
  30.             .......Delirium...........
  31.             .......Alhambra...........
  32.             .......MrZippy............
  33.  
  34.                      url's
  35.                     -------
  36.             ftp://ftp.netcom.com/pub/da/daemon9/*the Guild/
  37.             http://server.cs.jhu.edu/~jed/TheGuild/
  38.  
  39.  
  40.  
  41.  
  42. ------------------------------------------------------------------------------
  43. Summer 1995 [DefConIII] |  The Infinity Concept  |  issue 1                            
  44. ------------------------------------------------------------------------------                                 
  45.  
  46.  
  47.  
  48.     [Introduction]
  49.      
  50.  
  51.     Welcome to the first issue of the Infinity Concept.  This compendium 
  52. of information has been compiled and brought to you by members of the Guild.
  53. Our aim in this and future issues is the dissemination of useful and
  54. accurate information.  The Infinity Concept is here to provide you with the 
  55. best in today's technologies.  The articles themselves will usually have a 
  56. hacking tint to them, as much of our diverse backgrounds tend to converge 
  57. there, but don't be suprised to find an occasional wild-card...
  58.     It is our goal to disseminate legitimate information in a 
  59. discretionary, factual manner.   However, should you spot an obvious (or not-
  60. so-obvious) error please feel free to make a note of it and let the author of
  61. the article know about it.  We are ALL here to learn.  
  62.     
  63.     
  64.  
  65.  
  66.             Table of contents
  67.  
  68.             1).Electronic Privacy............................Route
  69.             2).Windows NT Security...........................Nihil
  70.             3).Computer Security Threat Response.............Zippy
  71.             4).Semi-Conductor Refrence books...................JFP
  72.             5).How to help keep your privacy..............Deliryum
  73.             6).Obtaining information on other people....Mythrandir
  74.             7).Linux Packet Sniffing....................Mythrandir
  75.             8).Phone Explorations.......................Mythrandir
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.                   .oO____Oo.
  83.  
  84.  
  85.     This, the first issue of The Infinity Concept, is set forth into 
  86. tumultous times.
  87.     The Guild is still relatively new and we have not set any standard 
  88. practices as yet.  This just makes for a somewhat hecktic schedule and slight 
  89. disorganization.  This will change, however, and we will become a cohesive 
  90. and solid unit as time goes on (esp. after DefConIII).  
  91.     Despite the rantings of a few misguided individuals, there is *NO* 
  92. dissention in our ranks and the Guild is not an information leeching group.  
  93. This electronic magazine is proof enough of that.  The anti-Guild propaganda 
  94. that was recently spread throughout .2600 is also a crock of shit.  
  95.     To further make things frantic, DefConIII is right around the corner.
  96. Several Guild members (including myself) will be there.  In an effort to get 
  97. ready to for the confrence, I have had to step up the schedule for this issue.
  98. Some members didn't have time to submit their articles, but pledge to next 
  99. issue (Fall 1995?).  
  100.     The fact that the two founding members (Nihil and myself) have 
  101. recently moved has not made things run any smoother, either...
  102.     Despite all the forementioned hoops, it is my opinion that we have put 
  103. together a solid compendium of useful knowledge.  The areas of expertise of 
  104. Guild members differ widely, and we have shown that here.  I think the 
  105. information hungry reader will find this an enjoyable, smart compilation.  
  106. Feel free to drop me a note and let me know what you think.
  107.  
  108.  
  109.         -Route, Guildmaster 
  110.  
  111.             
  112.  
  113.     ______________________________________________________________  
  114.     |Electronic Privacy - The Glory of Cryptography               |
  115.     |______________________________________________(the dark art)_|
  116.  
  117.  
  118.                 by Infinity
  119.  
  120.  
  121.  
  122.  
  123.     --[Abstract]--
  124.  
  125.  
  126.     It seems you just can't trust *anybody* these days.  The advent of the
  127. digital age has brought us wonderful advances in computing and communicating.  
  128. However, it has also brought with it the need for increased awareness of *who*
  129. is out there, and just *who* may be watching you.  
  130.     E-mail is not safe.  Anyone worth their weight in silicon can forge 
  131. mail, and clever individuals can read *anyone's* mail...  Your files are not 
  132. safe.  It's not much of a hack to browse through the directory structure of 
  133. a computer, and forget about hidden files...  Your off-line storage is not 
  134. safe.  Disks, tapes, CD-WORMS, Magno-optical disks, floptical, whatever the 
  135. technology, there is no considerable effort involved in stealing off-line 
  136. media and subsequently reading it.
  137.     Enter cryptography.
  138.     E-mail is now safe.  No one reads your mail, except for the intended 
  139. recipient.  Your files are now safe.  No one can touch them without your 
  140. passphrase.  Your disks are now safe.  No one can read a file without your 
  141. passphrase.  
  142.     You may wonder why people would want to get into your files... You 
  143. are somebody important, you know something important, you have something 
  144. important; you are nobody important, you know nothing important, you have 
  145. nothing important.  It doesn't matter: Some malicious crackers are nothing
  146. more than vandals, breaking into accounts and computers to cause damage and
  147. fuck around.  If they happen upon some interesting mail or files, great.  Some
  148. are more methodic; evil crackers that may target you or your organization, 
  149. in hopes of monetary gain, social notoriety among peers, or a personal 
  150. vendetta. (I won't even discuss the Federal Government.  God knows they don't
  151. read people's mail.)  For whatever reason, it happens.  Better safe than 
  152. sorry.
  153.     This paper is intended to introduce you (in a relatively technical 
  154. way) to cryptography.  It is not for the feint at heart.  If large numbers 
  155. scare you, read no further.  I assume a basic familiarity with the subject 
  156. (and familiarity with the complexity classes of the running time of 
  157. algorithms won't hurt).  I tend to jump around from topic to topic, as it is 
  158. the way I think, from one tangent to the next, but looking back, I believe 
  159. there is enough cohesiveness to tie this whole thing together nicely.  
  160.  
  161.  
  162.  
  163.     --[Symmetric key  vs.  Asymmetric key]--
  164.  
  165.     
  166.     There are two major types of cryptography (I won't even deal with 
  167. ciphers that don't utilize keys) symmetric (secret-key) and asymmetric 
  168. (public-key).  
  169.     In a symmetric system, one key is used for encryption and decryption
  170. (or the decryption key can be calculated from the encryption key).  The 
  171. message is encrypted with the secret-key and the process is reversed with the
  172. same key.  Getting the sender and receiver to agree on a key without any 
  173. potential attacker finding out is the major problem of the system.  If the 
  174. channels in which the messages are traveling are insecure (untrusted), how can
  175. the key be securely transmitted?  If the key was snooped, all future messages 
  176. could be decrypted by the attacker.  This issue of key management is the major
  177. problem in secret-key systems. 
  178.     In 1976 a better method for key management was developed.  Whitfield
  179. Diffie and Martin Hellman came up with a system involving two keys, both 
  180. related mathematically.  One key is kept private and the other is published 
  181. publicly.  A message encrypted by one is only decryptable by the other.  
  182. This solves the age old problem of secure key management.  Anyone can encrypt 
  183. a message with the public-key, but only the intended recipient (with the 
  184. corresponding private-key) can decrypt the message.  Furthermore, 
  185. authentication can be done in such a system.  If the owner of a given private 
  186. key encrypts (or cryptographically signs) a message with his key, only his 
  187. corresponding public-key will decrypt (or verify the signature) of the message.
  188. If they do not match, either the message has been altered, or the key used is 
  189. not the corresponding private-key.  In either case, the message is discarded.
  190.     The advantages of public-key over secret-key are obvious and great.  
  191. The need for secure channels in which to transmit a private key is not 
  192. necessary.  In a secret-key system there is always a risk that an attacker 
  193. could discover the secret-key through these insecure channels.
  194.     The other great advantage of public-key systems is the authentication 
  195. mechanism built into them.  Authentication via secret-key systems is clumsy 
  196. and can require a trusted third party (an arbitrator).  
  197.     One disadvantage (the only one?) of a public-key system is speed.  
  198. Some secret-key systems are orders of magnitude faster than some public-key 
  199. systems.  This may not be too noticeable for small messages, but on large files, 
  200. it quickly becomes undesirable.  The solution to this?  The hybrid-
  201. cryptosystem.
  202.     Using both public-key and secret-key cryptography, the best of both 
  203. worlds is achieved.  The public-key system is used to encrypt a psudeorandomly
  204. generated secret key that was used to conventionally encrypt the message.  
  205. This whole package can then be confidently sent across insecure channels.
  206.     
  207.     
  208.     [Some words on PGP]
  209.  
  210.     
  211.     This article will not focus on PGP, but as it is the premier hybrid 
  212. system, I feel the need to mention it.  PGP is one of those 'best of both 
  213. worlds' cryptosystems.  It uses a symmetric cipher for bulk encryption and 
  214. an asymmetic cipher for key exchange.  For digital signatures (authentication), 
  215. a one-way hashing function is used (a one-way hash is simply a function that 
  216. takes input and produces a unique fixed-size output that is not feasible to 
  217. duplicate, except with the same input).
  218.     PGP uses IDEA for bulk encryption (focused on, in depth below), RSA for
  219. key exchange (mentioned below), and MD5 for message digests.  The keysizes 
  220. currently used by PGP are 128-bits for the IDEA key, and 512-2048 for the RSA 
  221. keys.
  222.  
  223.  
  224.     [Some words on RANDOMNESS (as it pertains to cryptography)]
  225.  
  226.     
  227.     Cryptography is big on randomness.  Some systems (such as an engine 
  228. for a one-time pad) need an n-length string of random bits, for an n-length 
  229. message.  True randomness is not something easily achieved.  Computers are 
  230. INCAPABLE of generating a random sequence of bits.  The best a computer can do
  231. is a pseudo-random string.  
  232.     A pseudo-random bit generator is fine if it is cryptographically 
  233. secure.  To achieve this, the generator first of all needs to have a large 
  234. enough period (the period of a function is defined as the point in which it
  235. begins to repeat.  Sin is periodic at 2PI.) to be suitable for the 
  236. cryptosystem's needs.  Again using the one-time pad reference, if you have a 
  237. message of length n, and the generator is periodic at some point m<n, you have 
  238. a problem.  If the sequence of numbers repeats at some point, you have 
  239. completely sacrificed the strength of your cipher.  To be thought of as 
  240. cryptographically secure, a generator must not only pass statistical tests for
  241. randomness, but it also must be unpredictable.  It must be totally infeasible
  242. to predict the next bit given all the previous bits, and the way in which they
  243. were generated.
  244.  
  245.  
  246.     
  247.     --[Why it works (why it's safe)]--
  248.  
  249.     It's not presently possible to mathematically prove that any cipher
  250. is unbreakable (except a one-time pad--see below).  But, we can be reasonably
  251. sure that provably strong ciphers are safe from penetration, given a large
  252. enough keysize, and secure enough algorithm.
  253.  
  254.     
  255.     [Strength of Secret-key systems]
  256.  
  257.     The strength of any secret-key system (assuming an ideal cipher with 
  258. an impenetrably strong algorithm) resides in the key length.  That is, the
  259. number of different possible keys that the cipher could use to encrypt a 
  260. message.  This is usually a large number.  A very large number. (To get an idea, 
  261. see the chart below..)
  262.  
  263.     
  264.     CIPHER  KEY-LENGTH      IN BASE 10...
  265.  
  266.     DES     56-bits         7.2E16  
  267.     LOKI    64-bits         1.8E19
  268.     NEWDES  120-bits        1.3E36
  269.     IDEA    128-bits  340,282,366,920,938,463,463,374,607,431,768,211,456
  270.     
  271.     In order to retrieve the key, on average, half the key-space will need
  272. to be searched.  In the case of DES, if a computer could try 1,000,000 keys 
  273. per second (generating the key, decrypting the message and testing to see if
  274. you were successful), it would likely take 2,000 years to recover the correct 
  275. key.  LOKI keyspace would take almost 600,000 years to find a hit, and an
  276. IDEA key would take 10E25 years (the universe is only 10E10 years old) to 
  277. search for a match (if the same computer could try 1,000,000,000 keys, and 
  278. you had 1,000,000,000 of them, it would only take 10E13 years).  For more 
  279. info on the security of IDEA, see below.
  280.     So why not create a cipher with a 16,384-bit key? (My calculator can't
  281. even compute the size of it's keyspace.)  The caveat is this:  Remember that
  282. the algorithm must be perfectly secure so that there is no alternative to 
  283. brute force.  Cryptography is subtle art (thank you Bruce Schneier for that 
  284. wonderful quote).  It is not a simple task to create an algorithm that is 
  285. perfectly secure, and in many cases, increasing the key size will detract from
  286. the overall security.  A keyspace of 128-bits is not likely to be searched in 
  287. polynomial time without some RADICALLY new technology.
  288.  
  289.  
  290.  
  291.     [Strength of Public-key systems]
  292.  
  293.     The security of public-key systems resides in so-called 'trap door' 
  294. functions: Mathematical problems that are relatively easy to calculate in one 
  295. direction, but infeasible to calculate the inverse of.  Such problems as: 
  296. discrete logarithms in a finite field (it's complexity is not known, but is 
  297. thought to lie between P and NP-hard), knapsack problems (an NP-complete
  298. problem), and, the most famous, RSA which gets it's security from the 
  299. difficulty in factoring large numbers (a super-polynomial time problem).
  300.  
  301.  
  302.     [MH]
  303.  
  304.  
  305.     The Merkle-Hellman public-key system gets it's security from the 
  306. knapsack problem (actually, this algorithm has been broken, but it is still a 
  307. good example of a trap-door function).  In a nutshell:
  308.  
  309.     The knapsack problem is best described with the thief analogy: A thief
  310. robbing a safe finds it filled with N types of items of varying size (and 
  311. value), but only has a knapsack of capacity M<N to carry the items.  The 
  312. problem is to find a combination of items to maximize the total value of what
  313. he chooses.  The problem is solvable for relatively small input values, but
  314. seems to grow exponentially with the number of items in the safe.
  315.     The MH system encodes a message as a solution to a series of knapsack
  316. problems.  A block of plaintext equal in length to the number of items would
  317. select the items, and ciphertext would be sum (a binary 1 in the plaintext 
  318. indicates inclusion, while a 0 is indicates exclusion of the item in question):
  319.  
  320.         PLAINTEXT 
  321.         BLOCK (in
  322.         binary)   1 0 0 1 1 1 0     0 0 0 0 0 0 0 0    1 1 1 1 1 1 1  
  323.         KNAPSACK: 
  324.         BLOCK    1 7 9 20 30 43 60 1 7 9 20 30 43 60 1 7 9 20 30 43 60
  325.  
  326.         
  327.         RESULTING 
  328.         CIPHERTEXT
  329.         BLOCK:     (1+20+30+43)   (0)               (1+7+9+20+30+43+60)           
  330.                 94              0               170                             
  331.  
  332.  
  333.     The security comes from the non-superincreasing knapsack (which is the
  334. public key).  A superincreasing knapsack is one where every term in the series
  335. is greater then the sum of the all previous terms.  A superincreasing knapsack
  336. is relatively trivial to solve.  With non-superincreasing knapsacks, the only 
  337. way to figure which items were included in the knapsack, is to test ALL 
  338. possible solutions, until the correct one is found.  This is NOT an easy 
  339. problem.  The fastest solution's complexity grows exponentially, scaling with
  340. the number of items in the knapsack.  With a knapsack of sufficient size (200 
  341. or more items) and sufficient item complexity, solving it on a computer that 
  342. can try 1,000,000 possible solutions a second, it would likely take 10E46 
  343. years.  The universe is only 10E11 years old...
  344.     In MH, the private-key is the series of weighted items for a 
  345. superincreasing knapsack problem.  The public-key is a series of weighted 
  346. items for a non-superincreasing knapsack problem with the same solution.
  347.     In any event, the MH public-key system was broken by Adi Shamir 
  348. (of RSA fame) and (?) Zippel by finding a way to construct the superincreasing 
  349. knapsack from the non-superincreasing one.
  350.         
  351.  
  352.  
  353.     [RSA]
  354.  
  355.     The RSA Public-key system is the most popular and well known 
  356. public-key system.  It is widely believed that RSA gets it's security from the 
  357. difficulty in factoring large numbers (it's possible that another method for 
  358. breaking RSA may be discovered, but it hasn't surfaced yet).
  359.     
  360.         The math of RSA is simple:
  361.  
  362.         Take two large primes, p and q.
  363.  
  364.         Find the product n of pq (which is the public modulus).
  365.  
  366.         Randomly choose a number e, such that: e<n and e is relatively
  367.         prime to (p-1)(q-1).                    
  368.     
  369.         Use Euclid's algorithm to compute d [which is the inverse
  370.         mod(p-1)(q-1) or ed = 1 mod (p-1)(q-1)].
  371.  
  372.         e is the public exponent, and d is the private one.
  373.  
  374.         The public-key is (n,e) and private key is d.
  375.  
  376.         p and q must be destroyed.
  377.  
  378.  
  379.  
  380.     The security comes from the difficulty in factoring the public modulus 
  381. n.  Prime factorization of large numbers is not an easy problem (it has not
  382. been proven that factoring *must* be as difficult as it is, but no one has 
  383. discovered an easier way to go about it).  The fastest algorithms are of the
  384. super-polynomial complexity class.  While not easy, factoring technology has
  385. jumped LEAPS and BOUNDS in the past few years.  In 1977 Ron Rivest (of RSA 
  386. fame) said that factoring a 125-digit number would take 40 quadrillion years.  
  387. In 1994 a 129-digit number was factored.  In June of 1995 the 116-digit 
  388. Blacknet key was factored.  The table below shows time estimates for factoring 
  389. several keysizes using the general number field sieve (GNFS) (a MIPS-year is 
  390. a 1,000,000 instruction per second computer running for one year, or 3E13 
  391. instructions).
  392.  
  393.  
  394.  
  395.         Key size in bits        MIPS-years required to factor
  396.         
  397.         512                     3E5
  398.         768                     2E8
  399.         1024                    3E11
  400.         1280                    1E14
  401.         1536                    3E16
  402.         2048                    3E20
  403.  
  404.  
  405.     A related algorithm, the special number field sieve (SNFS) is faster 
  406. still then the GNFS.  The SNFS is actually more efficient on special number 
  407. types that are not too often used in cryptography, but the SNFS is relevant 
  408. to a factoring discussion.  The SNFS has faster times accordingly.
  409.      
  410.          Key size in bits        MIPS-years required to factor
  411.  
  412.         512                     <200
  413.         768                     1E5
  414.         1024                    3E7
  415.         1280                    3E99
  416.         1536                    2E11
  417.         2048                    4E14
  418.  
  419.  
  420.     If you are thinking that a 1024-bit key is unconditionally safe, here 
  421. are some assumptions from the mathematicians who factored RSA-129:
  422.  
  423.  
  424.         We believe that we could acquire 100 thousand machines without
  425.         superhuman or unethical efforts.  That is, we would not set 
  426.         free an Internet worm or virus to find resources for us.  Many
  427.         organizations have several thousand machines each on the net.  
  428.         Making use of their facilities would require skillful 
  429.         diplomacy, but should not be impossible.  Assuming the 5 mips
  430.         average power, and one year elapsed time, it is not too 
  431.         unreasonable to embark on a project which would require half
  432.         a million mips years.
  433.  
  434.     Frightening indeed.
  435.  
  436.  
  437.     [What key size should I choose?]
  438.  
  439.     
  440.     To determine a desirable keysize, you need to assertain the security 
  441. you need vs. the lifetime of the key.  I am assuming (as most people using 
  442. cryptography would) that you want maximum security.  Since no realistic 
  443. predictions of factoring speed can be realistically made beyond a few years, 
  444. the keysize chosen should be a factor (no pun intended) of this.  Today you 
  445. need a 1024-bit number to get the level of security you got from a 512-bit 
  446. number in the early 1980s.  If you want your key (and data) to remain secure
  447. for 20 years, and you do not plan to (or cannot) change it, 1024 bits is likely
  448. too short.  Choose an implementation that allows for a larger keysize.  
  449. Something about 2048-bits just makes me feel good...
  450.  
  451.  
  452.     Below is the announcement posted by Paul Leyland about the successful
  453. PGP public-key modulus prime factorization. (If you try to check the 
  454. signature integrity, you may notice it doesn't check.  I went a little hay 
  455. -wire with the spell checker...)
  456.  
  457. ---------------------------------BEGIN INCLUDED TEXT---------------------------
  458.  
  459.  
  460. -----BEGIN PGP SIGNED MESSAGE-----
  461.  
  462.  
  463. We announce the first known hostile attack on a PGP public key.
  464.  
  465. In 1993, Tim May created BlackNet as a proof-of-concept implementation
  466. of an information trading business with cryptographically protected
  467. anonymity of the traders.  He created a 1024-bit key, and invited
  468. potential traders to encrypt their sales pitch and a public key for a
  469. reply with the BlackNet key, posting the result in one or more Usenet
  470. newsgroups.  BlackNet would then reply in the same manner.  The original
  471. proposal went only to a few people and May acknowledged his authorship
  472. shortly afterwards, when his pedagogical point had been made. It was
  473. soon posted to the Cypherpunks list, and from there to Usenet.  Six
  474. months afterwards in February 1994, a 384-bit key was created in the
  475. BlackNet name, and the BlackNet message was spammed to hundreds of
  476. newsgroups by the new key owner, L. Detweiler.
  477.  
  478. At least one message was posted encrypted in the 384-bit key.  The
  479. encryptor, either by design or by unwitting use of PGP's encrypttoself
  480. option, also encrypted the message to his own key, exposing his identity
  481. to anyone who cared to look him up on the key servers and use finger.
  482.  
  483. Factoring 384-bit integers is not too difficult these days.  We wanted
  484. to see whether it could be done surreptitiously.  Jim Gillogly picked
  485. the 384-bit BlackNet key as a suitable target, partly because of its
  486. apparent interest and partly because he had saved a copy of the reply.
  487. Paul Leyland took the key to pieces.  The public exponent was found to
  488. be 17 and the public modulus:
  489.  
  490. 3193508200533105601431099148202479609827976414818808019973596061739243\
  491. 9454375249389462927646908605384634672078311787
  492.  
  493. To factor this 116-digit integer, we used the same technology as the
  494. RSA-129 project which completed last year.  That computation was so
  495. large that it was necessary for it to be done in a blaze of publicity in
  496. order to attract enough resources.  Ours, we estimated, would take about
  497. 400 mips-years, less than a tenth of the earlier one.  Arjen Lenstra and
  498. Paul Leyland have been factoring integers for years, Lenstra with a
  499. MasPar at Bellcore and Leyland with a dozen or so workstations at Oxford
  500. University.  Alec Muffett has been contributing to factorizations for
  501. almost a year, using forty or so machines outside working hours at Sun
  502. Microsystems UK.  Jim Gillogly threw a couple of machines into the pot,
  503. for a total peak power of around 1300 mips, plus the MasPar.  The
  504. computation began on March 21st on the workstations and continued until
  505. June 23rd.  Lenstra slipped in three weeks runtime on the MasPar between
  506. other factorizations; he also performed the matrix elimination and
  507. emailed the factors (PGP-encrypted) to Leyland. About 50% of the
  508. computation was done by the MasPar.
  509.  
  510. The factors, as can easily be checked, are:
  511. 5339087830436043471661182603767776462059952694953696338283
  512. and
  513. 5981374163444491764200506406323036446616491946408786956289
  514.  
  515. Over in Oxford, a doctored PGP was created.  It could generate only
  516. one secret key, that from two primes hard-coded into it.  The key was
  517. generated and tested on the following message:
  518.  
  519. > -----BEGIN PGP MESSAGE-----
  520. > Version: 2.6
  521. > hDwDqeLyyFpa0WsBAYCumTBz0ZUBL7wC8pMXS4mBS0m3Cf6PrPer+2A0EQXJZM46
  522. > OvPnqNWz5QK3Lwyg9DeEqAPF5jH/anmgXQEE3RNhybQUcqnOSVGMO2f5hjltI73L
  523. > 8CRXhFzMCgjdCwTRf0Oq61j4RAptUviqhDq/r7J2FpY7GwpL5DxuJ+YrWNep69LK
  524. > Q/CkKxtwvv2f0taly4HCLCcqw59GQ5m++WnOwDQWKG7yUaXJuUG/mJdr/o+ia3y+
  525. > QKyqOesHdSjWoXDpK7F2Cvxf2KpV3+vzbv+TriRyDV+zR/8womdJl6YAAAKtmWO2
  526. > fy0sp/cqr/1ZGQKmfZWz5L0bh1e/sJXJq9PjvPc05ePxZ35XEoRTCqxbq2GPynkH
  527. > YSynfXZY//814TKmdQxPBvkc8Nbi0rc/GYyoAmItDui4mQISYskGkmLieoWDDlpP
  528. > E9tZlb/7Xa22QS53Or6DwU/y226WXQvrWq5OJ+8OhQyEnLWsEdfgFoe1l9aeweX5
  529. > 0ao5lcp098Q4JFfQWoaU9D7kmKvg+AVT44Pv16/nPvihAoC2O14xg7t1U8032ybs
  530. > 4FLpvxyqoF7+oDV/QNw4Evk1ZnxE5+PH2sOf1qCJdljVSd3wGSfUQaDPRx5RH0XC
  531. > SAgYMsIRaytpdoq521tHUZt2BIg7Ii89TfUBrnkenBFAqdZAf+JR1PSB4yaV3YtG
  532. > PCS4lNQkmWx+ItjP0zsHVcAR0TiBcpV0gMY+tx0h40CTkDi2vHiVyswSJr4halsW
  533. > SIixrdi6B0i3f7v7xlOpFI2khza1c/dH8nrF1uPLECeAZ8TQq53ZlyN472KYuTVZ
  534. > 8y5NqyXd672dYEtzsOlUa9YwFKKyGisyDhZmE5wSOg2Pjopvl0WkuZSR/kdxrX/N
  535. > hFdfXRy1Kgkr+vz9abumhcWS5lYCCfVLk/CIgRqHO09nlEJCTb1T/U788Gptr3/d
  536. > 3dj8C/LECdY7fIdkmTgYhXmfv7fQxLWln29Yux0cEpRq2ud8rjYVSuEaTUO9dF4n
  537. > 9oFRsPdbb0TOxaMVFm2hnELzeKAk/poInfEZkN2ZnusxJ4aM1HkBRva+CAMhQHdT
  538. > XMisoNawWEDPwiwu91owIrBevPJNvX155jUTwKNj0UPBwS6TfS5gXl9g+LoBnMWQ
  539. > nbMMMYVXbJVsAeVOlzTSBftpbglx1k7ocDaAJTZ3OCjf0FcKJsa+4Hybc713611c
  540. > WSHV5esfY9k/yw==
  541. > =nLfz
  542. > -----END PGP MESSAGE-----
  543.  
  544. A successful decryption resulted in:
  545.  
  546. >   Although I realize blacknet was a hoax of some sort, I'm curious as
  547. > to the reasons behind it and I would like to know the motives of the 
  548. > person who did it, malicious to make fun of cypher punks or simply
  549. > poking fun at cyberspace in general.
  550. >    I'm interested in forming a similar net, not for the buying and 
  551. > selling of information, but for the fun of doing it, who knows what might 
  552. > come about in a network somewhat limited and away from the internet, but
  553. > based on pgp without people flaming, and without the netloons like
  554. > dwetler and sternlight, (I have my doubts about dwetler's actual motives
  555. > in spamming the mailers)
  556. >   SO, hopefully they key I encrypt it to is the actual one, and if not
  557. > hopefully whoever is intercepting this is as interested in creating 
  558. > what I am, why else be eaves dropping??
  559. >   Looking forward to hearing from whoever out there, and
  560. > I hope you're competent enough with unix to extract my pgp key
  561. > from my .plan
  562. > --
  563. > Finger yusuf921@raven.csrv.uidaho.edu for PGP public key 2.6ui
  564. > GJ/GP -d+ H+ g? au0 a- w+++ v+(?)(*) C++++ U++1/2 N++++ M-- -po+ Y+++
  565. > -         t++ 5-- j++ R b+++ D+ B--- e+(*) u** h* r+++ y?  
  566. >
  567.  
  568. The next step was to create a revocation certificate and send that off
  569. to the PGP key servers.  After all, the key has undoubtedly been
  570. compromised.
  571.  
  572. The moral of this story is that 384-bit keys can be broken by a small
  573. team of people working in secret and with modest resources.  Lest anyone
  574. object that a MasPar is not a modest resource, we'd re-iterate that it
  575. did only 50% of the work; that we took only three months and that we
  576. used only 50 or so quite ordinary workstations.  We believe that we
  577. could have used at least twice as many machines for at least twice as
  578. long without anyone noticing. The currently minimum recommended key
  579. size, 512 bits, is safe from the likes of us for the time being, but we
  580. should be able to break them within five years or so.  Organizations
  581. with more than "modest resources" can almost certainly break 512-bit
  582. keys in secret right now.
  583.  
  584. Alec Muffett    alec.muffett@uk.sun.com
  585. Paul Leyland    pcl@oucs.ox.ac.uk
  586. Arjen Lenstra   lenstra@bellcore.com
  587. Jim Gillogly    jim@acm.org
  588.  
  589. and, of course, BlackNet<nowhere@cyberspace.nil>     8-)
  590.  
  591. P.S.   The 384-bit BlackNet secret key is:
  592.  
  593. > -----BEGIN PGP MESSAGE-----
  594. > Version: 2.6.2i
  595. > lQDAAy/ty1QAAAEBgM98haqmu+pqkoqkr95iMmBTNgb+iL54kUJCoBSOrT0Rqsmz
  596. > KHcVaQ+p4vLIWlrRawAFEQABfAw0gFVVGhzZF63Nc8HJin4jAy2WgIOsvST5ne1Y
  597. > CbfyDIZ6siTHUAos8wMBQZ6Q8QDA2b6tiYqrGu6E1+F0DGPSk9MGif5/LKFrAMDz
  598. > 8HXIK1zrEFEDq9/5dUXO2rk1tH+mkAEAv0EE9e5EJn+quL3/YvAg6bKOlM7HgVKq
  599. > JEDDtCBCbGFja05ldDxub3doZXJlQGN5YmVyc3BhY2UubmlsPg==
  600. > =/BEI
  601. > -----END PGP MESSAGE-----
  602.  
  603.  
  604. -----BEGIN PGP SIGNATURE-----
  605. Version: 2.6
  606.  
  607. iQCVAwUBL+6HEzt/x7zOdmsfAQGRpQP9FZluArrT5+zsG/R6y/MF7O3d7ArEkVe2
  608. rUQgP7W2NxudAFHTNaL9mqLBDVNW/3PqWIhvHMtrSgG+ZAFBH5bP03tizfOFr+SL
  609. eO1JQgYFey7Wh5J/YCuE0VTlYMZ7bhnoiGIvTYZgxIzVWAYyGmlWKRDjfKz/Pks8
  610. qavbPg6qbPo=
  611. =s12J
  612. -----END PGP SIGNATURE-----
  613. --
  614. Paul Leyland <pcl@sable.ox.ac.uk>        | Hanging on in quiet desperation is
  615. Oxford University Computing Services     |     the English way.
  616. 13 Banbury Road, Oxford, OX2 6NN, UK     | The time is gone, the song is over.
  617. Tel: +44-1865-273200  Fax: 273275        | Thought I'd something more to say.
  618. Finger pcl@sable.ox.ac.uk for PGP key    |
  619.  
  620.  
  621. -------------------------------------END INCLUDED TEXT-------------------------
  622.  
  623.  
  624.  
  625.     [Why a (proper) ONE-TIME PAD is unbreakable]
  626.  
  627.     A one-time pad is the only provably perfect cryptosystem.  A one-time 
  628. pad is a simple symmetric cryptosystem.  If a message of length n needs to be 
  629. encrypted, a pseudo-random sequence of bits of length n is generated.  The 
  630. message is then XORed with the pad.  The pad must be generated by a 
  631. cryptographically secure PRNG (pseudo-random number generator) and can only be
  632. used once per communication, and must be transmitted securely.  If this 
  633. protocol is followed, you have perfect secrecy.    
  634.     Since the ciphertext yields *no* possible information about the 
  635. plaintext, with the possible exception of it's length, no cryptanalysis can be 
  636. performed on the ciphertext.  A given ciphertext is equally likely to be any 
  637. possible plaintext of equal size, and there is no way of knowing which of the 
  638. decryptions is valid.  You could spend an eternity trying all the possible 
  639. solutions, and never be sure which is the proper meaning of the original 
  640. message.
  641.     
  642.  
  643.  
  644.  
  645.     --[The IDEA algorithm]--
  646.  
  647.  
  648.     The International Data Encryption Algorithm, designed by Xuejia Lai 
  649. and James Massey, was originally called PES (Proposed Encryption Standard).  
  650. It was demonstrated to be vulnerable to a differential cryptanalysis attack 
  651. in 1990 and had to be strengthened.  The result of the strengthening was 
  652. called IPES (Improved Proposed Encryption Standard), and, in 1992 the name
  653. was changed to IDEA.
  654.     IDEA is a symmetric cipher with a 128-bit key, that operates on 
  655. 64-bit blocks of data, divided into 4 16-bit sub-blocks, for eight rounds.  
  656. IDEA mangles data by mixing operations from three algebraic groups: XOR, 
  657. addition modulo 2E16, and multiplication modulo 2E16+1.  These operations
  658. are encased within the algorithm itself, and involve no external permutations
  659. (unlike DES's E-box). The operations operate on the 16-bit sub-blocks of 
  660. data, so IDEA is efficient on slower 16-bit processors.  Like most symmetric
  661. ciphers, IDEA uses confusion and diffusion to obscure the redundancies that
  662. naturally occur in a plaintext message (esp. if that message is English text):
  663.     Confusion is where relations between the plaintext and ciphertext 
  664. is obscured.  This makes cryptanalysis of the ciphertext more difficult, as 
  665. there are fewer redundancies to exploit.  Substitution is one method of 
  666. confusion (remember the Caesar Cipher?).
  667.     Diffusion is where the redundancy of a plaintext message is spread 
  668. out through the ciphertext.  This dissipation of the plaintext message 
  669. further frustrates attempts to locate redundancies.  Transposition is one 
  670. method of diffusion.
  671.  
  672.  
  673.     [IDEA in 14 easy steps]
  674.     
  675.     
  676.     Below is a basic overview of one round of IDEA (This information
  677. originally appeared in Bruce Schneier's book, Applied Cryptography).  A 64-bit
  678. data block is divided into 4 16-bit sub-blocks (X1-X4).  These four blocks
  679. become the input to the first round of the algorithm.  In each round, the 
  680. four sub-blocks are XORed, added, and multiplied with one another and with 6 
  681. 16-bit sub-blocks of key material.  Between each round, the second and third 
  682. sub-blocks are swapped.
  683.     In each round, this is what happens:
  684.  
  685.  
  686.         1. Multiply X1 and the first key sub-block.
  687.         2. Add X2 and the second key sub-block.
  688.         3. Add X3 and the third key sub-block.
  689.         4. Multiply X4 and the fourth key sub-block.
  690.         5. XOR the results of step 1 and step 3.
  691.         6. XOR the results of step 2 and step 4.
  692.         7. Multiply the results of step 5 with the fifth key sub-block.
  693.         8. Add the results of step 6 and step 7.
  694.         9. Multiply the results of step 8 with the sixth key sub-block.
  695.         10. Add the results of step 7 and step 9.
  696.         11. XOR the results of step 1 and step 9.
  697.         12. XOR the results of step 3 and step 9.
  698.         13. XOR the results of step 2 and step 10.
  699.         14. XOR the results of step 4 and step 10.
  700.  
  701.     The output of the round is the four sub-blocks that are results of 
  702. steps 11, 12, 13, and 14.  The input to the next round is the two inner 
  703. blocks of the previous round, reversed.  After the 8th round, the first four 
  704. steps are repeated, and the four sub-blocks are re-attached to form the final 
  705. ciphertext block.
  706.     
  707.     
  708.     [Key sub-block creation]
  709.  
  710.     The algorithm uses 52 key sub-blocks (6 for each of the eight rounds, 
  711. and 4 more for the final output).  The 128-bit master key is divided in 8 
  712. 16-bit sub-keys.  These are the first 8 sub-keys used by the algorithm (6 for 
  713. the first round, 2 for the second).  The master key is then rotated (bitwise) 
  714. 25-bits to the left, and divided again into eight sub-keys.  The first four 
  715. are used in round two; the last four are used in the third round.  The 
  716. master key is again rotated 25-bits to the left and divided into 8 sub-keys, 
  717. and so on until the end of the algorithm.
  718.  
  719.     
  720.     [Decryption]
  721.  
  722.     IDEA, being a symmetric cipher, goes through the same process for 
  723. decryption, as it does for encryption.  The only difference is that the key 
  724. sub-blocks are reversed and slightly different.  The decryption key 
  725. sub-blocks are either additive or multiplicative inverses of the encryption 
  726. key sub-blocks.  The decryption keys are more computationally intensive to 
  727. compute than the encryption keys, and that time is negligible. (sort of.. see 
  728. below).
  729.  
  730.  
  731.     [Security of IDEA]
  732.  
  733.     IDEA is a new algorithm;  too new for any concrete proofs of security 
  734. one way or the other.  It is conceivable that the NSA or some such group has 
  735. come up with a better method than brute-force, but it is unlikely they have, 
  736. or at least, unlikely that the public sector would know about it if they had.  
  737. IDEA *looks* very secure.  So far, the best method publicly known for 
  738. breaking IDEA, is by a brute-force search of it's keyspace.
  739.     As I stated before, a brute-force attack is absolutely infeasable.  
  740. It gets worse.  Generating encryption sub-keys is much faster than generating
  741. decryption sub-keys.  When a brute-force attack is waged against a ciphertext 
  742. block, this time adds up, as each new attempt requires a new decryption key.  
  743. The time to compute all the additive and multiplicative inverses can double 
  744. or triple the necessary time and/or resources needed to launch such an attack.
  745.     
  746.     
  747.     [Weak keys]
  748.  
  749.     A weak key is a key that compromises the security of a cryptosystem 
  750. in one fashion or another, making some attacks easier. (DES has 4 weak keys, 
  751. and 12 semi-weak keys.)  The IDEA weak keys are weak in the sense that if 
  752. used, an attacker can exploit them in a chosen-plaintext attack.  (A chosen 
  753. plaintext attack is where an attacker has access to the plaintext and 
  754. ciphertext for several messages, and can choose the encrypted plaintext.  
  755. This allows the attacker to exploit chosen parts of a message, and possibly
  756. glean more information about the key.) A weak key example:
  757.  
  758.         0000,0000,0x00,0000,0000,000x,xxxx,x000
  759.  
  760.     'x' can be any number.  The chance of accidentally generating one of 
  761. these keys is 2E-96.  Not too likely.
  762.  
  763.  
  764.  
  765.     --[Source]--
  766.  
  767.     IDEA is patented, but is usable without restriction for noncommercial 
  768. use.  Please note the keying function below is *not secure*.  It uses a 
  769. simplified key, in that it takes up to 8 characters and casts each one into a
  770. 16-bit word, by shifting it left 8 bits, and OR'ing it with the previous 
  771. character (0 for the first character), making 8 16-bit subblocks of the key,
  772. which is no where near as complex a key as possible.  I would recommend 
  773. either writing a better keying function, or finding a secure 128-bit hash to 
  774. use.  In any event, the code is really here to learn from.  You cannnot be 
  775. sure whether or not it has been altered from the original code (I cannot be 
  776. sure, as it had no signature to check the integrity).  If you want more or 
  777. less guaranteed security, use PGP's conventional encryption function.
  778.  
  779.  
  780. ---------------------------------BEGIN INCLUDED TEXT---------------------------
  781.  
  782. /* idea.h */
  783.  
  784. #ifndef _IDEA_DOT_H
  785. #define _IDEA_DOT_H
  786.  
  787. #include <stdio.h>
  788. #include <time.h>
  789. #include <process.h>
  790. #include <io.h>
  791. #include <string.h>
  792. #include <conio.h>
  793.  
  794. #define IDEAKEYSIZE 16
  795. #define IDEABLOCKSIZE 8
  796. #define word16 unsigned int
  797. #define word32 unsigned long int
  798. #define ROUNDS  8
  799. #define KEYLEN  (6*ROUNDS+4)
  800. #define tempfilename "tempfile.Σnc"
  801.  
  802.  
  803. int end_of_file,noisy,overwrite;   /*global vars*/
  804.  
  805. #define low16(x) ((x) & 0xffff)
  806.  
  807. typedef unsigned int uint16;
  808. typedef word16 IDEAkey[KEYLEN];
  809.  
  810. /*IDEA Algorithm functions */
  811. void en_key_idea(word16 userkey[8],IDEAkey Z);
  812. void de_key_idea(IDEAkey Z, IDEAkey DK);
  813. void cipher_idea(word16 in[4],word16 out[4],IDEAkey Z);
  814. uint16 inv(uint16 x);
  815. uint16 mul(uint16 a,uint16 b);
  816.  
  817. /*file handling functions*/
  818. char read_char_from_file(FILE *fp);
  819. word16 read_word16_from_file(FILE *fp);
  820. void write_char_to_file(char data,FILE *fp);
  821. void write_word16_to_file(word16 data,FILE *fp);
  822. void cipher_file(FILE *in,FILE *out,word16 *key);
  823. void decipher_file(FILE *in,FILE *out,word16 *key);
  824. void swap_files_and_clean_up(char *file);
  825.  
  826. #endif
  827.  
  828.  
  829. /* End idea.h */
  830.  
  831.  
  832.  
  833.  
  834.  
  835. /*IDEA.C   v2.2
  836.     c source code for IDEA block cipher. IDEA (International Data
  837.     Encryption Algorithm), formerly known as IPES (Improved Proposed
  838.     Encryption Standard). Algorithm developed by Xuejia Lai and James L.
  839.     Massey, of ETH Zurich. This implementation modified and derived from
  840.     original C code developed by Xuejia Lai. Zero-based indexing added,
  841.     names changed from IPES to IDEA. CFB functions added. Random Number
  842.     routines added. Optimized for speed 21 Oct 92 by Colin Plumb
  843.     <colin@nsq.gts.org>  This code assumes that each pair of 8-bit bytes
  844.     comprising a 16-bit word in the key and in the cipher block are
  845.     externally represented with the Most Significant Byte (MSB) first,
  846.     regardless of internal native byte order of the target cpu.
  847.     modified for use with PC files by Colin Maroney 4/1/94*/
  848.  
  849. /*   USAGE:     pass a key made up of 8 16-bit numbers (word16) in an array
  850.         ("word16 key[8];"), an input FILE * and an output temporary
  851.         FILE * to either encode_file() or decode_file().
  852.         where the key comes from is up to you.
  853.         then call swap_files_and_clean_up() with the original file's
  854.         name as the argument, to replace the original file
  855.         with the encoded data (stored in the temporary file).
  856.  
  857.         you can remname the tempfile to be used in idea.h
  858.         noisy is an integer which tells encrypting/decrypting
  859.         functions to echo a "." every 256 writes, so the user can
  860.         see that something is happening. set it to 0 for quiet
  861.         running.
  862.  
  863.         please note that for really good security the original file
  864.         is overwritten before being erased if you use the w switch.
  865.         otherwise it outputs a file "<filename>.enc"
  866.  
  867.         the main() used here as illustration reads the filename
  868.         from the command line arguments, as well as a command
  869.         "e" or "d" to tell it whether to encrypt or
  870.         decrypt, and a key.  the older versions had an interface
  871.         for when a command line was not use.  lack of editing 
  872.         features made this buggy, so i axed it. */
  873.  
  874.  
  875. #include "idea.h"
  876.  
  877. static uint16 inv(uint16 x){
  878.  
  879.     uint16 t0,t1;
  880.     uint16 q,y;
  881.     if(x<=1)return x;
  882.     t1=(uint16)(0x10001l/x);
  883.     y=(uint16)(0x10001l%x);
  884.     if (y==1)return low16(1-t1);
  885.     t0=1;
  886.     do{
  887.         q=x/y;
  888.         x=x%y;
  889.         t0+=q*t1;
  890.         if (x==1)return t0;
  891.         q=y/x;
  892.         y=y%x;
  893.         t1+=q*t0;
  894.     }while (y!=1);
  895.  
  896.     return low16(1-t1);
  897. }
  898.  
  899. static void en_key_idea(word16 *userkey, word16 *Z){
  900.  
  901.     int i,j;
  902.  
  903.     /* shifts */
  904.     for (j=0;j<8;j++)Z[j]=*userkey++;
  905.  
  906.     for (i=0;j<KEYLEN;j++){
  907.         i++;
  908.         Z[i+7]=((Z[i&7] << 9) | (Z[i+1 & 7] >> 7));
  909.         Z+=i&8;
  910.         i&=7;
  911.     }
  912. }
  913.  
  914. static void de_key_idea(IDEAkey Z,IDEAkey DK){
  915.  
  916.     int j;
  917.     uint16 t1,t2,t3;
  918.     IDEAkey T;
  919.     word16 *p=T+KEYLEN;
  920.     t1=inv(*Z++);
  921.     t2=-*Z++;
  922.     t3=-*Z++;
  923.     *--p=inv(*Z++);
  924.     *--p=t3;
  925.     *--p=t2;
  926.     *--p=t1;
  927.  
  928.     for (j=1;j<ROUNDS;j++){
  929.         t1=*Z++;
  930.         *--p=*Z++;
  931.         *--p=t1;
  932.         t1=inv(*Z++);
  933.         t2=-*Z++;
  934.         t3=-*Z++;
  935.         *--p=inv(*Z++);
  936.         *--p=t2;
  937.         *--p=t3;
  938.         *--p=t1;
  939.     }
  940.  
  941.     t1=*Z++;
  942.     *--p=*Z++;
  943.     *--p=t1;
  944.     t1=inv(*Z++);
  945.     t2=-*Z++;
  946.     t3=-*Z++;
  947.     *--p=inv(*Z++);
  948.     *--p=t3;
  949.     *--p=t2;
  950.     *--p=t1;
  951.  
  952.     /*copy and destroy temp copy*/
  953.     for(j=0,p=T;j<KEYLEN;j++){
  954.         *DK++=*p;
  955.         *p++=0;
  956.     }
  957. }
  958.  
  959.  
  960. uint16 mul(uint16 a, uint16 b){
  961.  
  962.     word32 p;
  963.  
  964.     if(a){
  965.         if(b){
  966.             p=(word32)a*b;
  967.             b=(uint16)(low16(p));
  968.             a=(uint16)(p>>16);
  969.             return b-a+(b<a);
  970.         }
  971.         else return 1-a;
  972.     }
  973.     else return 1-b;
  974. }
  975.  
  976. #define MUL(x,y) (x=mul(low16(x),y))
  977. #define CONST
  978.  
  979. static void cipher_idea(word16 in[4],word16 out[4],register CONST IDEAkey Z){
  980.  
  981.     register uint16 x1,x2,x3,x4,t1,t2;
  982.     int r=ROUNDS;
  983.  
  984.     x1=*in++; x2=*in++;
  985.     x3=*in++; x4=*in;
  986.     do{
  987.     MUL(x1,*Z++);
  988.     x2+=*Z++;
  989.     x3+=*Z++;
  990.     MUL(x4,*Z++);
  991.     t2=x1^x3;
  992.     MUL(t2,*Z++);
  993.     t1=t2+(x2^x4);
  994.     MUL(t1,*Z++);
  995.     t2=t1+t2;
  996.     x1^=t1;
  997.     x4^=t2;
  998.     t2^=x2;
  999.     x2=x3^t1;
  1000.     x3=t2;
  1001.     }while(--r);
  1002.  
  1003.     MUL(x1,*Z++);
  1004.     *out++=x1;
  1005.     *out++=(x3+*Z++);
  1006.     *out++=(x2+*Z++);
  1007.     MUL(x4,*Z);
  1008.     *out=x4;
  1009. }
  1010.  
  1011. char read_char_from_file(FILE *fp){
  1012.  
  1013.     char temp=0;
  1014.  
  1015.     if((fread(&temp,sizeof(char),1,fp))!=1)end_of_file=1;
  1016.  
  1017.     return(temp);
  1018. }
  1019.  
  1020. word16 read_word16_from_file(FILE *fp){
  1021.  
  1022.     word16 temp=0;
  1023.  
  1024.     if((fread(&temp,sizeof(word16),1,fp))!=1)end_of_file=1;
  1025.  
  1026.     return(temp);
  1027. }
  1028.  
  1029. void write_char_to_file(char data,FILE *fp){
  1030.  
  1031.     if((fwrite(&data,sizeof(char),1,fp))!=1){
  1032.         printf("Fatal Error writing output file!!!\n");
  1033.         exit(-1);
  1034.     }
  1035. }
  1036.  
  1037. void write_word16_to_file(word16 data,FILE *fp){
  1038.  
  1039.     if((fwrite(&data,sizeof(word16),1,fp))!=1){
  1040.         printf("Fatal Error writing output file!!!\n");
  1041.         exit(-1);
  1042.     }
  1043. }
  1044.  
  1045.  
  1046. void cipher_file(FILE *in,FILE *out,word16 *key){
  1047.  
  1048.     word16 input[4],output[4];
  1049.     IDEAkey Z;
  1050.     int x,y;
  1051.     int count=0;
  1052.     long length;
  1053.     int temp;
  1054.  
  1055.     en_key_idea(key,Z);
  1056.     end_of_file=0;
  1057.  
  1058.     length=filelength(fileno(in));
  1059.     fwrite(&length,sizeof(long),1,out);
  1060.  
  1061.     while(!end_of_file){
  1062.         x=0;
  1063.  
  1064.         while (x<4){
  1065.             input[x]=((word16)(read_char_from_file(in)<<8));
  1066.             if (!end_of_file){
  1067.                 temp=read_char_from_file(in);
  1068.                 if (temp<0)temp+=256;
  1069.                 input[x]=input[x]|temp;
  1070.                 x++;
  1071.             }
  1072.             if(end_of_file){
  1073.                 while (x<4) input[x++]=0;
  1074.                 break;
  1075.             }
  1076.         }
  1077.         cipher_idea(input,output,Z);
  1078.         for (y=0;y<x;y++){
  1079.             if(noisy)if(count++%256==0) printf(".");
  1080.             write_word16_to_file(output[y],out);
  1081.         }
  1082.     }
  1083. }
  1084.  
  1085. void decipher_file(FILE *in,FILE *out,word16 *key){
  1086.     word16 input[4],output[4];
  1087.     int x,y;
  1088.     IDEAkey Z,DK;
  1089.     int count=0;
  1090.     long length=0;
  1091.  
  1092.     en_key_idea(key,Z);
  1093.     de_key_idea(Z,DK);
  1094.  
  1095.     end_of_file=0;
  1096.  
  1097.     fread(&length,sizeof(long),1,in);
  1098.  
  1099.  
  1100.     while (!end_of_file){
  1101.         x=0;
  1102.         while(x<4){
  1103.             input[x]=read_word16_from_file(in);
  1104.             if(end_of_file)break;
  1105.             x++;
  1106.         }
  1107.             cipher_idea(input,output,DK);
  1108.             for (y=0;y<x;y++){
  1109.                 if(noisy)if(count++%256==0) printf(".");
  1110.                 if(length-->0)write_char_to_file(((char)(output[y]>>8)),out);
  1111.                 if(length-->0)write_char_to_file(((char)(output[y]&255)),out);
  1112.             }
  1113.         }
  1114. }
  1115.  
  1116. void swap_files_and_clean_up(char *file){
  1117.     long fsize,count;
  1118.     FILE *fp;
  1119.     char temp[100];
  1120.  
  1121.     if(overwrite){
  1122.         if ((fp=fopen(file,"r+b"))==NULL)printf("\nError overwriting old file, security compromised.\n");
  1123.  
  1124.         else{
  1125.             fseek(fp,0l,SEEK_END);
  1126.             fsize=ftell(fp);
  1127.             fseek(fp,0l,SEEK_SET);
  1128.             for (count=0;count<fsize;count++)fputc('0',fp);
  1129.             fclose(fp);
  1130.         }
  1131.  
  1132.         if ((remove(file))!=0){
  1133.             printf("\nERROR removing old file <%s>\n",file);
  1134.             printf("encoded data remains in temporary file <%s>\n",tempfilename);
  1135.             exit(-1);
  1136.         }
  1137.     }
  1138.  
  1139.     else{
  1140.         strcpy(temp,file);
  1141.         file=strtok(temp,".");
  1142.         strcat(file,".enc");
  1143.     }
  1144.  
  1145.     if ((rename(tempfilename,file))!=0){
  1146.         printf("\nERROR renaming temporary file <%s>!!\n",tempfilename);
  1147.         printf("Data is safely processed and stored in that file.\n");
  1148.         exit(-1);
  1149.     }
  1150. }
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156. /*-----------------------------------------------*/
  1157.  
  1158.  
  1159. #define KBYTES 1024
  1160.  
  1161. void getuserkeyfromargv(word16 *key,char *arg){
  1162.  
  1163.     int x;
  1164.  
  1165.     for (x=0;x<strlen(arg) && x<8;x++){
  1166.         if (x==0) key[x]=arg[x]<<8;
  1167.         else key[x]=((arg[x]<<8)|(key[x-1]>>8));
  1168.     }
  1169.  
  1170.     if(strlen(arg)>8)printf("\nONLY first *8* characters of key used!!!\n");
  1171.  
  1172.     if(x<8)while(x<8)key[x++]=0;
  1173. }
  1174.  
  1175. main(int argc, char **argv){
  1176.  
  1177.     word16 userkey[8];
  1178.     char filename[100];
  1179.     FILE *fp,*temp;
  1180.     int to_or_from;
  1181.  
  1182.     noisy=1;
  1183.     overwrite=0;
  1184.  
  1185.     if (argc!=4){
  1186.         printf("\nUsage: idea filename.ext [e|d[w]] key\n");
  1187.         printf("          e=encode   d=decode   w=overwrite file\n");
  1188.         printf("       NOTE: Key must be no longer than 8 characters long!!!\n");
  1189.         exit(-1);
  1190.     }
  1191.  
  1192.     else{
  1193.         strncpy(filename,argv[1],99);
  1194.         filename[99]='\0';
  1195.         if (argv[2][0]=='e') to_or_from=1;
  1196.         else if(argv[2][0]=='d') to_or_from=0;
  1197.             else{
  1198.                 printf("\nUsage: idea filename.ext [e|d[w]] key\n");
  1199.                 printf("        e=encrypt d=decrypt w=overwrite file\n");
  1200.                 printf("       NOTE: Key must be no longer than 8 characters long!!!\n");
  1201.                 exit(-1);
  1202.             }
  1203.         if (argv[2][1]=='w') overwrite=1;
  1204.         getuserkeyfromargv(userkey,argv[3]);
  1205.     }
  1206.  
  1207.  
  1208.     if ((fp=fopen(filename,"r+b"))==NULL){
  1209.         printf("\nError opening File %s\n",filename);
  1210.         exit (-1);
  1211.     }
  1212.  
  1213.     if((temp=fopen(tempfilename,"w+b"))==NULL){
  1214.         printf("\nError opening temporary file\n");
  1215.         exit(-1);
  1216.     }
  1217.  
  1218.     if (to_or_from==1){
  1219.         printf("\nEncoding file %s   ",filename);
  1220.         cipher_file(fp,temp,userkey);
  1221.     }
  1222.     else{
  1223.         printf("\nDecoding file %s   ",filename);
  1224.         decipher_file(fp,temp,userkey);
  1225.     }
  1226.  
  1227.     fclose (fp);
  1228.     fclose(temp);
  1229.  
  1230.     swap_files_and_clean_up(filename);
  1231.  
  1232.     return 0;
  1233. }
  1234.  
  1235. ---------------------------------END INCLUDED TEXT-----------------------------
  1236.  
  1237.  
  1238.     --[How to implement cryptography securely]--
  1239.  
  1240.  
  1241.     You can be using the most secure algorithm available, and be using it 
  1242. improperly, and sacrifice all the security it has to offer. This section 
  1243. includes some general things to be wary of, to have optimum success with 
  1244. whatever algorithm you are using.
  1245.  
  1246.  
  1247.     [Passphrase/word picking]
  1248.  
  1249.     First things first.  Why bother using all of the worlds computers in a 
  1250. parallel brute force search or prime factorization, when a poorly chosen 
  1251. password is the only obstacle (if you deadbolt your door, don't leave the 
  1252. hinges off).  Poor passwords are the number one way in which ALL of computer 
  1253. security is compromised.... 
  1254.  
  1255.         THINGS YOUR PASSWORD SHOULD *NOT* BE:
  1256.         
  1257.         -In any dictionary.
  1258.         -A real word.
  1259.         -Anything that can be deduced from knowing you.
  1260.         -And for GOD'S sake NOT written down.
  1261.  
  1262.         THINGS YOUR PASSWORD *SHOULD* BE:
  1263.  
  1264.         -The full length allowable by the implementation.
  1265.         -Of mixed case, numerics and special characters.
  1266.         -Something you learn to type quickly w/o looking at the keyboard.
  1267.         -Something you DO NOT forget.
  1268.  
  1269.     
  1270.     [Dangers of a multi-user system]
  1271.  
  1272.     Using cryptography on a multi-user system can be dangerous.  There are 
  1273. multitudes of attacks possible, with the feasibility and implementation 
  1274. depending on the particular OS.  There are so many possible attacks: key 
  1275. logging, memory space snooping, swap-file reading, trojan horses, etc...  
  1276. Granted some of these attacks are sophisticated.  I supposed your level of 
  1277. paranoia depends on what you are seeking to hide, but, my advice is to never 
  1278. underestimate the sophistication of your enemy.  My further advice is NOT to
  1279. use cryptography on an untrusted multi-user system.
  1280.  
  1281.         
  1282.     [Van-Eck devices]
  1283.  
  1284.     All electronic equipment emits electrical and electromagnetic 
  1285. radiation.  Van-Eck devices are devices that intercept this radiation from 
  1286. computer equipment and are able to reassemble the data displayed therein.  
  1287. Van Eck devices can be very hard to detect, as they can be installed out of 
  1288. site from the target.  Van Eck devices can be built for around $300.00 from 
  1289. parts available at Radio Shack.  The implications of this are obvious and 
  1290. potentially severe.  Unfortunately, apart from outfitting your equipment 
  1291. with TEMPEST certified products (or shielding the rooms with lead), there 
  1292. isn't much you can do about this threat, except be wary of just who is 
  1293. driving a van in your neighborhood with limo'd out windows and parked in
  1294. front of your house...    
  1295.  
  1296.  
  1297.     [Packet-Sniffing]
  1298.  
  1299.     Packet-sniffing is another 'invisible threat'.  Packet sniffers are 
  1300. very hard to detect, because most are passive, not altering or producing data, 
  1301. just recording what zips on by.  Some implementations of crypto products will
  1302. send some sort of initialization value or even a key (or password) across the
  1303. wire in the clear.  I'd avoid using them. (Unfortunately, one of the most 
  1304. commonly networked OS's, Unix, is vulnerable to this attack.  It sends login 
  1305. names and passwords in the clear both upon logging in and in ftp and telnet 
  1306. sessions.  Of course, there are alternatives, such as Kerberos or a revised 
  1307. ftp or telnet client [and daemon].)
  1308.  
  1309.  
  1310.     
  1311.     --[In closing]--
  1312.     
  1313.     
  1314.     In this world of tinsel locks, privacy is a dangerous illusion.
  1315.  
  1316.     As the world inexoribly heads towards a completely computer controlled
  1317. society we will need some level of assurance that our secrets remain secret.
  1318. Cryptogrpahy can provide this assurance.  It is my humble opinion (and not 
  1319. much of a revalation) that cryptography will become much more commonplace in
  1320. the years to come.  
  1321.     As far as today goes, cryptography is largely a misunderstood artform.  
  1322. When some people think of cryptography they think of super-spys and large 
  1323. governments.  The people that DO know about modern day cryptography, often 
  1324. implement it incorrectly, sacraficing it's security.  The few that do know 
  1325. need to teach the masses that don't know.  It is important to show them *why* 
  1326. to use it, not just how.  
  1327.     It is also important to keep cryptography legal and thriving.  If the 
  1328. power of unbreakable ciphers is put in the hands of the few government 
  1329. officials and outlawed for the masses, it would be a tragedy.  More than a 
  1330. tragedy, it would be a violation of our intrinsic right to privacy.  I don't
  1331. remember where I read it:  When cryptography is outlawed, only outlaws will 
  1332. have cryptography.
  1333.  
  1334. He who controls the information will control the world.
  1335.  
  1336.     In the uneducated words of one late actor:
  1337.  
  1338.         "...You won't get in...It's encrypted..."
  1339.  
  1340.  
  1341.  
  1342.     --[Credit where credit is due]--
  1343.  
  1344.     
  1345.     This paper could not have been possible without the following:
  1346.  
  1347.     - Bruce Schneier for his GODSEND book _APPLIED_CRYPTOGRAPHY_, 
  1348.       which I find myself constantly reading. 
  1349.  
  1350.     - Bruce Schneier for answering my questions.
  1351.  
  1352.     - The gracious community of SCI.CRYPT for answering my questions.
  1353.  
  1354.     - Paul Fahn of RSA Laboratories for the SCI.CRYPT FAQ.
  1355.     
  1356.     - Introduction to Algorithms, a very, very large and very theory-
  1357.       oriented book.
  1358.  
  1359.     - Paul Rubin, Adam Back, and several others for their help.
  1360.  
  1361.     - Alec Muffet, Paul Leyland, Arjen Lenstra, and Jim Gillogly for 
  1362.       factoring the Blacknet key and showing us just how important large
  1363.       keys are.
  1364.  
  1365.     - Some inate hunger for knowledge I developed somewhere along the 
  1366.       line...
  1367.  
  1368.  
  1369.  
  1370.                   .oO____Oo.
  1371.  
  1372.  
  1373.  
  1374.  
  1375.     ______________________________________________________________  
  1376.     |Windows NT Security                                          |
  1377.     |_____________________________________________________________|
  1378.  
  1379.  
  1380.                   by the Nihilist
  1381.  
  1382.  
  1383. 1.1  The Subject of Trust
  1384.  
  1385. Within any network security model, the subject of trust is always an area of 
  1386. great complexity.  The Windows NT security model centers around the concept 
  1387. of a domain, in which a single sign-on is necessary to access any resources 
  1388. (file services, print services, and program execution) where permissions have
  1389. been granted. A domain model, such as the one used in Windows NT, offers ease
  1390. of use for both users and for general administration but also offers many 
  1391. possible avenues of exploit for those inclined.  The model is made more 
  1392. complex when the concept of a trusted domain is introduced. 
  1393.  
  1394. A trusted domain is another domain with which an explicit connection is made 
  1395. through a trust relationship. In Windows NT a trust relationship is one way 
  1396. *and* non-transitive. In order to have two domains trust each other, there 
  1397. must be two trust relationships established, one from domain A to domain B 
  1398. and another trust from B to A.  Once a trust relationship is created, 
  1399. permissions must be explicitly granted in the trusting domain if users from 
  1400. the trusted domain are to have access to resources in it.  The idea of 
  1401. non-transitive trust is that if domain A trusts domain B and domain B trusts 
  1402. domain C then domain A does not trust domain C.  
  1403.  
  1404. Windows NT inherently handles the mechanisms of trust and permissions securely
  1405. by using ACLs (Access Control Lists), process and user Ids, and 
  1406. cryptographically signed tokens. Nowhere in authentication are clear text 
  1407. passwords used, except with FTP, telnet and a few other UNIX like utilities
  1408. (the r commands and telnet are only clients on NT[1], so the security of the 
  1409. serving host would be the one compromised unless the passwords are the same on
  1410.  both systems).  But these mechanisms do not, by any means, guarantee a secure
  1411. environment without careful administration and guidelines. 
  1412.  
  1413. Invariably, there are nuances to the security mechanisms in all operating 
  1414. systems and network operating systems, Windows NT is no different.  In the case
  1415. of trust relationships, there is a significant peculiarity to be aware of.
  1416. Once a trust relationship is established, it should be able to be broken by 
  1417. either domain, the trusting or the trusted, at any time.  What really happens
  1418. (in versions 3.1 and 3.5) is that either or both sides can sever the trust 
  1419. connection but it will remain in effect until the Primary Domain Controller 
  1420. (PDC) in either domain is rebooted.  The ramifications of this would only come
  1421. into play if an administrator or user in the trusting domain made data or 
  1422. resources available expecting that members of the formerly trusted domain did 
  1423. not have access.  Another case maybe that it was expected that the data in a 
  1424. share would not be updated, but a user of the trusted domain, unaware, made 
  1425. changes because she/he could.  The way to prevent a situation like this from 
  1426. happening is to remove the permissions from the resource, opposed to relying 
  1427. on the breaking of trust.
  1428.  
  1429. A more insidious bug I uncovered is the ability to view and *possibly* change
  1430. or create user information in the trusting domain.  Normally the trusting 
  1431. domain has access to user names and groups from the trusted domain in order to
  1432. grant permissions to resources, but the trusted domain does not have access to
  1433. the trusting domain's user database.  I created a trust relationship between 
  1434. a Windows NT 3.1 Advanced Server domain, the trusting domain, and a Windows NT
  1435. 3.5 Server domain, the trusted domain.  Immediately after establishing the 
  1436. trust, I opened the User Manager in the trusted domain and attempted to view
  1437. the user database of the trusting domain.  I was able to view *all* the 
  1438. information regarding user accounts, groups, and the domain's security policy
  1439. which includes minimum password length, password aging, logon hours, tries
  1440. before lockout, and user rights.  At the time I was unable to attempt adding
  1441. or modifying a user account.  None the less, revealing this information is 
  1442. enough of a breach of security by itself.  Remember, knowledge is power.  I 
  1443. have not had the resources available to me to thoroughly test the extent of 
  1444. this bug, but I do know that any further attempts to view the user information
  1445. were denied.  For this bug to be exploited, one must be in the Administrators 
  1446. group of a domain controller or in the Domain Admin group of the trusted 
  1447. domain and possibly do a little social engineering.
  1448.  
  1449. To this point, I have discussed trust in the NT sense of the word, but if one 
  1450. applies a more philosophical view of trust to Windows NT they will see it 
  1451. extends much deeper into the networking model.  The concept of single sign-on
  1452. in a network requires an authority, or trusted, service to validate access to
  1453. resources across multiple hosts. What this implies is that if someone can 
  1454. crack or circumvent the trusted validation mechanisms then that individual 
  1455. has a free reign as far as the trust extends.  The scope of a breach of 
  1456. this nature would include the local domain and it would extend to any 
  1457. trusting domains where permission has been granted to resources.   
  1458.  
  1459. When users logon to Windows NT, a security access token, which contains the 
  1460. user's security ID, group security IDs, user name, group names, and user 
  1461. rights, is created by the system from information stored in the security 
  1462. account manager database (similar to the UNIX /etc/passwd database, but 
  1463. contains much more information and is encrypted. The default location of the
  1464. database is %SystemRoot%\system32\config\SAM).  All processes created by the 
  1465. user, or run on the users behalf (impersonation), have the user's security 
  1466. access token attached.  When a process tries to access a protected object, 
  1467. the Security Reference Monitor (the only access validation code in the system, 
  1468. which I believe is embedded in the kernel) checks the user's security token 
  1469. against the object's DACL and grants or denies access based on the local 
  1470. system's policies and standard validation routines.  The SAM database is 
  1471. always open by a process, therefore it can not be copied or deleted regardless 
  1472. of the user's security level[2].  It maybe possible for a system level program
  1473. to gain access to or delete the database, but the old UNIX problem of snatching
  1474. password files seems to be eliminated.   Therefore, the areas that seem most 
  1475. likely to be exploited revolve around security access tokens and the logic in 
  1476. the Security Reference Monitor.  If processes do not set or reset tokens 
  1477. correctly or the Security Reference Monitor deals with obscure situations 
  1478. illogically, then holes like the trust bug mentioned earlier could be opened.  
  1479. The significance of these holes is magnified because they possibly affect 
  1480. multiple servers. 
  1481.  
  1482.  
  1483. 1.2  Do I have permission?
  1484.  
  1485. Windows NT has probably shut the door on the less technical cracker, but poor 
  1486. administration could open the door back up.  By default, the directory and 
  1487. file permissions leave the system software unnecessarily open to all, a 
  1488. situation that begs to be exploited through trojan horses.  Also, some of the 
  1489. management utilities will allow any user to view information about the system 
  1490. like user names, group names, and application and system logs.  I prefer to 
  1491. not give out any information about my systems other than what is necessary to 
  1492. accomplish the intended work.  I suggest setting file permissions by hand in 
  1493. the %SystemRoot% and system32 directories.  The entire system32 directory can 
  1494. be made read only to the everyone group to prevent trojan horses and 
  1495. tampering, and the management utilities can be made only accessible to the 
  1496. administrators group and any other group or user responsible for accounts and
  1497. management.  Also, it should never be necessary to share the system32 directory[3].
  1498.  
  1499. If a user can delete files from the system32 directory, it is very easy to 
  1500. obscure the audit logs by simply removing three files: MSAuditE.dll, 
  1501. MSObjs.dll, and IOLogMsg.dll.  These three files supply the text of the audit 
  1502. entries, and without them the entries become very cryptic (but with some work 
  1503. one can still figure out what happened, or else just replace the files).
  1504.  
  1505. The %SystemRoot%\system32\config directory is a prime target since it 
  1506. contains the system databases and audit logs.  The default permissions are 
  1507. well thought out, but there is a precautionary measure that can be taken to 
  1508. insure that even if there is a complete security breach the audit logs can not
  1509. be erased.  The Registry can be modified to write the logs to a WORM (Write 
  1510. Once Read Many) device, if one is available.  I recommend this type of 
  1511. configuration for RAS hosts and Internet gateways or any other host that needs
  1512. robust auditing.  In the following example, the Registry has been modified to
  1513. write the security log to a WORM drive mapped to drive X:
  1514.  
  1515. Key Name:          SYSTEM\CurrentControlSet\Services\EventLog\Security
  1516. Class Name:        <NO CLASS>
  1517. Last Write Time:   6/15/95 - 8:58 AM
  1518. Value 0
  1519.   Name:            File
  1520.   Type:            REG_EXPAND_SZ
  1521.   Data:                  X:\Log\SecEvent.Evt
  1522.  
  1523.  
  1524. 1.3  TCP/IP and Security
  1525.  
  1526. Running TCP/IP in a Windows NT environment does not *by it self* open any 
  1527. security holes (it is my protocol of choice), but some of the services and
  1528. applications that have become standard in the UNIX environment do.
  1529.  
  1530. FTP and Telnet are two prime examples of services that will send passwords
  1531. un-encrypted on the wire.  With such services it is really the server that is 
  1532. compromised, because this is where the revealed password can be used to gain 
  1533. access.  At this point, up to and including build 1057 (version 3.51) of Windows 
  1534. NT, it can only be a server for FTP, with the exceptions mentioned previously.  
  1535. The recommended configuration for a FTP server under NT is to *only* allow 
  1536. anonymous access, this way no passwords for the NT machine will be divulged.
  1537.  
  1538. The real danger comes in a heterogeneous environment where users synchronize 
  1539. passwords on their NT accounts and on some other system, such as a UNIX box, 
  1540. and use  unsecure services like Telnet and FTP.  A local attacker can sniff 
  1541. packets at the ethernet or IP level to capture the passwords, and a remote 
  1542. attacker can possibly spoof a local router or host and have the IP packets 
  1543. sent to a remote machine to be captured and analyzed.  The best defense is to 
  1544. educate users on secure password practices and create utilities to try and 
  1545. test for bad habits.
  1546.  
  1547. If operating in a pure NT environment, refrain from using UNIX style services
  1548. and use the standard NT networking services.  With the NT services you are 
  1549. protected from the standard and not so standard password and IP spoofing 
  1550. attacks.  Even if an attacker spoofs a connection, they still have to deal 
  1551. with the signed tokens servers and processes check.
  1552.  
  1553. There is one danger of information leakage with TCP/IP.  If the host is multihomed, any application that binds to a port on one interface expecting to only send data on that network will be in for a big surprise.  There is *no* guarantee that packets will
  1554.  only be sent on the interface the port is bound to. If one NIC is on a private network and the other is on a public network, there could be problems[5].  This issue is apparently fixed in the build 1057 bits.   
  1555.  
  1556.  
  1557. 1.4 Closing Comments
  1558.  
  1559. Build 1057 of Windows NT has cleaned up a lot of the internals, and since 
  1560. I have only had access to it for three days[4], I have not tested it out
  1561. *yet*.  My words to live by are still: don't trust your users, don't think C2 
  1562. means secure, and don't think that nobody can get in.  Have fun!
  1563.  
  1564.  
  1565. Footnotes               
  1566.  
  1567. 1  There are third parties that supply telnet and r command daemons, but the 
  1568. security issues involved with the current versions of the software are 
  1569. tremendous (the documentation warns of this in some cases). It is possible for
  1570. an individual who is using the server locally to see what is being executed 
  1571. remotely and enter commands to be executed as the remote user. This prompts 
  1572. me to recommend against their use unless security is of NO concern.  
  1573. Microsoft supplies an unsupported client/server remote command execution 
  1574. utility (rcmdsvc.exe and rcmd.exe) with the Resource Kit that does not send 
  1575. passwords in the clear, but I can not speak as to whether it is actually secure.
  1576.  
  1577. 2  It could be possible to kill the process which has the database open.  
  1578. This might leave the file wide open since the group everyone has full control.
  1579.  
  1580. 3  It is possible to replace files in the system32 (or any other directory) by
  1581. doing a "copy trojan.exe \\target_machine\c$\%SYSTEMROOT%\system32\AT.EXE" if 
  1582. the permissions are not set correctly. 
  1583.  
  1584. 4  Ah, but now I have access to thousands of them! and source! very LARGE.
  1585.  
  1586. 5  I believe this will only manifest itself if the host thinks the destination
  1587. can be reached through the other interface.  Probably rare, but I have seen it 
  1588. happen.
  1589.  
  1590.                   .oO____Oo.
  1591.  
  1592.  
  1593.  
  1594.      _____________________________________________________________
  1595.     |  Computer Security Threat Response                          |
  1596.     |______________________________________(is your system safe?)_|
  1597.  
  1598.  
  1599.  
  1600.                   by MrZippy
  1601.  
  1602.  
  1603.  
  1604. ---[ 1.0 ]---
  1605.       INTRODUCTION 
  1606.  
  1607.     If you forgot the password on your home computer, you'd be happy to
  1608. find that all you have to do is pull a jumper and the password is cleared
  1609. out.  However, no system administrator wants access to his/her system to be
  1610. that easy.  In order to stay ahead of those desiring to break into their
  1611. systems, sysadmins need a way to stay on top of security risks to their
  1612. systems.
  1613.  
  1614.     Several computer security orginazations were formed in order to
  1615. centralize reports of security threats and fixes for them.  There have been
  1616. numerous discussions about the impact of making this type of information
  1617. available to the public, but it is my (and many other people's) opinion that
  1618. publishing security loopholes can only make systems more secure. If someone
  1619. does manage to gain entry to a system through a well-documented loophole,
  1620. then it must be considered the sysadmin's fault for not taking action to
  1621. close the hole.
  1622.  
  1623.     So, how does a sysadmin (or anyone else, for that matter) become
  1624. informed of a possible security threat?  There are many security-related
  1625. orginazitions that publish information on potential problems.  The three
  1626. major players are CERT, FIRST, and [8LGM].  This article is intended to
  1627. give you an overview about what these groups are about.  The URL of each
  1628. orginazation is provided so you may further explore them.
  1629.  
  1630.  
  1631. ---[ 1.1 ]---
  1632.       CERT [Computer Emergency Response Team]
  1633.     <http://www.sei.cmu.edu:80/SEI/programs/cert.html>
  1634.  
  1635.     CERT is probably the most well-known of all computer security
  1636. organizations. Based at the Carnegie Mellon University, they provide
  1637. 24-hour technical assistance for responding to computer security 
  1638. incidents, product vulnerability assistance, technical documents, 
  1639. and seminars. The most visible of CERT's activities are it's 
  1640. *CERT Advisories*.  These advisories are posted to a mailing list and 
  1641. Usenet news groups, and are archived at CERT's FTP site.
  1642.  
  1643.     The advisories are usually NOT highly technical, and provide only an
  1644. overview of a potential threat rather than a detailed description of
  1645. exactly how to exploit the threat.  In their words, 
  1646.      
  1647.      "A CERT advisory provides information on how to obtain a patch or
  1648.       details of a work around for a known computer security problem. "
  1649.  
  1650. CERT advisories are extremely useful to sysadmins, because they outline how
  1651. to fix a problem and where to obtain the resources to do it. .  They are
  1652. less useful to someone wishing to exploit the security hole because of the
  1653. lack of technical information.
  1654.  
  1655.     In addition to publishing Advisories, CERT maintains a FTP site
  1656. containing all sorts of informative materials.  Archives of all CERT
  1657. Advisories are stored here, as well as an archive of security-related
  1658. Usenet articles.  You can find RFC 1244 (the Site Security Handbook),
  1659. RFC 1281 (the Guidelines for the Secure Operation of the Internet), and the
  1660. Department of Defense's "Orange Book."  Also kept at the site are security-
  1661. related papers, technical tips for securing a system, and a small
  1662. collection of security tools.
  1663.  
  1664.  
  1665. ---[ 1.2 ]---
  1666.       8LGM [8-Legged Groove Machine]
  1667.       <http://www.8lgm.org/>
  1668.  
  1669.     8LGM is similar to CERT in that they also publish security Advisories.
  1670. They actively report any vulnerabilities they find directly to the vendors
  1671. that are affected.  The Advisories that 8LGM publishes are made known to
  1672. the relevant organizations (such as CERT), but are generally much more
  1673. detailed than a CERT Advisory.
  1674.  
  1675.     8LGM maintains not only a list of Advisories, but also a full write-up
  1676. on how to exploit the security bug.  The exploits are only posted after a
  1677. patch or fix has been found.  Most of these exploit files contain working
  1678. shell scripts which demonstrate the exact problem and how easy it is to
  1679. utilize it.  This is provided to assist sysadmins in closing the hole and
  1680. preventing any possible future exploit of the same bug.
  1681.  
  1682.     The exploit files are only available through 8LGM's email file server.
  1683. People requesting exploit files are warned that their names may be
  1684. published if 8LGM feels it necessary.  Since the exploit files are not made
  1685. available until a patch to the bug is available, it's unlikely that
  1686. the information can be used in a harmful way unless a sysadmin is unaware
  1687. of the problem in the first place.
  1688.  
  1689.     I find the 8LGM archive interesting because it is able to answer
  1690. questions about EXACTLY how a particular loophole was utilized. You can
  1691. gain a better understanding of the extent someone will go to gain
  1692. access to a system, and also gain a greater sense of appreciation for the
  1693. security advisory organizations.  It quickly becomes apparent how easily a
  1694. system can be compromised.      
  1695.  
  1696.  
  1697. ---[ 1.3 ]---
  1698.       FIRST [Forum of Incident Response and Security Teams]
  1699.       <http://www.first.org/first/>
  1700.  
  1701.     FIRST is made up of members of Computer Response Teams from around
  1702. the world, including government agencies, Universities, and commercial
  1703. organizations.  It's main purpose is to share information between it's
  1704. members.  
  1705.  
  1706.     FIRST is not a public organization - the information shared between
  1707. members is generally not for release to the public.  In fact, FIRST members
  1708. must sign a non-disclosure agreement before being admitted.  Members may
  1709. write their own advisories, (like CERT does), but the text of
  1710. communications between FIRST members stays secret.
  1711.  
  1712.     Not much else is known about FIRST.  Since they do not publish their
  1713. own advisories, they do not maintain a public archive.  The information
  1714. they have made available mainly discusses it's goals, but shows no examples
  1715. of how or if they have achieved them. FIRST states that any of it's members
  1716. may be contacted with security problems, and that member will assist you
  1717. with a solution. Currently, the following organizations are members of FIRST:
  1718.  
  1719.   ------------------------------------------------------------
  1720.   Air Force (US)                        Micro Bit Virus Center (Germany)
  1721.   ANS (US)                              Motorola (US)
  1722.   Apple Computer (US)                   NASA Ames (US)
  1723.   Assist (US)                           Nasirc (US)
  1724.   Auscert (Australia)                   Navcrt (US)
  1725.   Bellcore (US)                         Navy (US)
  1726.   Boeing (US)                           Nist (US)
  1727.   BSI (Germany)                         Nordunet (Denmark)
  1728.   CCTA (UK)                             Penn State (US)
  1729.   CERT                                  Purdue University (US) 
  1730.   CERT-IT (Itally)                      Rentar (France)
  1731.   CIAC-Doe (US)                         SBA (US)
  1732.   Cisco (US)                            Sun Microsystems (US)
  1733.   DDN (US)                              Surfnet (Netherlands)
  1734.   DEC (US)                              Switch (Switzerland)
  1735.   Defense Research Agency (UK)          TRW (US)
  1736.   DFN-CERT (Germany)                    UK Agencies (UK)
  1737.   Dow (US)                              Unisys (US)
  1738.   EDS (US)                              US Sprint (US)
  1739.   GE (US)                               Veteran's Health Admin (US)
  1740.   Goddard (US)                          Westinghouse (US)
  1741.   Goldman (US)
  1742.   HP (US)
  1743.   J. P. Morgan (US)
  1744.   MCI (US)
  1745.   ------------------------------------------------------------
  1746.  
  1747.     After reviewing the types of organizations involved in FIRST, it is
  1748. very possible that major breakthroughs in computer security are originated
  1749. here.  Notice, though, that the only organization which actually releases
  1750. information to the public is CERT.  This makes you wonder what FIRST
  1751. members know that they're not sharing with the rest of the world.
  1752.  
  1753. ---[ 1.4 ]---
  1754.       CONCLUSION
  1755.  
  1756.     Hopefully, this has made you more aware of a few of the resources
  1757. available to sysadmins and non-admins alike.  The reason that any of the
  1758. organizations mentioned in this article make this type of information
  1759. available to the public is to educate them.  The more who know about the
  1760. risks involved in running a computer system, the more secure they will be.
  1761. Unless the information provided is completely disregarded by those running
  1762. the systems, it is rare that the knowledge gained from these advisories
  1763. can be used in a harmful manner.
  1764.  
  1765.  
  1766.                   .oO____Oo.
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772. UNTAPPED RESOURCES:  SEMICONDUCTOR REFERENCE BOOKS AND MANUFACTURERS
  1773. ====================================================================
  1774. By J. Frank Parnell
  1775.  
  1776.  
  1777. Many hackers would like to build their own electronic projects, but feel the
  1778. knowledge required to do so is beyond them.  This, in fact, is untrue.  This
  1779. article will hopefully help those people.  The information talked about in
  1780. this article is oriented to people with a basic knowledge of electronics. If
  1781. you don't know a resistor from a capacitor then you should pick up "Getting
  1782. Started In Electronics" (part # 276-5003) from Radio Shack.  It's only $2.99
  1783. and can help give you a basic understanding of electronics and electronic
  1784. circuits.
  1785.  
  1786.  
  1787.  
  1788.     Part 1 - Semiconductor Reference Books
  1789.     --------------------------------------
  1790.  
  1791. Most hackers know a computer user is only as good as the reference material
  1792. they have available (or have memorized).  Well, the same holds true for
  1793. electronics.  There is one difference though--most electronics related
  1794. reference material may be obtained free of charge.
  1795.  
  1796.  
  1797. What are they?
  1798. ==============
  1799.  
  1800. Semiconductor reference books (also known as databooks) contain a wealth of
  1801. information.  They are meant to help engineers and technicians design and
  1802. construct circuits in an easy and straightforward manner.  There are books
  1803. for resistors, books for capacitors, books for transistors, books for
  1804. integrated circuits, etc.  The most useful of these books are the integrated
  1805. circuit (IC) databooks.  These IC databooks come in many flavors (power,
  1806. digital, linear, etc.), and from many sources (National, Motorola, Texas
  1807. Instruments, etc.).  At the end of this article is a list of semiconductor
  1808. manufacturers for your reference.  First, I will explain a bit about the
  1809. different types of books.
  1810.  
  1811.     Linear                  Analog circuits (amplifiers, voltage
  1812.                 regulators, radio and TV circuits).
  1813.  
  1814.     Logic (TTL)             Digital circuits (logic chips mostly.  AND 
  1815.                 gates, multiplexers, data bus drivers).
  1816.  
  1817.     Microprocessor          Like the name says, microprocessors.
  1818.  
  1819.     Memory                  Again, like it says, "memory."
  1820.  
  1821.     Power                   Usually things like high power transistor
  1822.                 switches and high output audio drivers.
  1823.  
  1824.     Interface               Line drivers, RS-232 interface chips, etc.
  1825.  
  1826.     Data conversion/        Analog to digital converters and such.
  1827.     acquisition
  1828.  
  1829. These are the most common types of books.  There are others also, but these
  1830. books will be the ones you encounter most often.
  1831.  
  1832.  
  1833. Why would I want them?
  1834. ======================
  1835.  
  1836. So you're asking yourself, "Why in the heck would I want to find out the
  1837. technical details of chips and stuff."  Well, let me tell you.  Along with
  1838. all the technical specifications in these books there are also "typical
  1839. applications."  These are schematics, and sometimes circuit board designs,
  1840. of common electronic circuits used in everyday consumer equipment.  The
  1841. engineers at these companies, some of the brightest people around, have sat
  1842. down and designed almost every conceivable use of each chip their company
  1843. manufactures.  They have done such a good job that people with just a
  1844. rudimentary knowledge of electronics can take this info and build themselves
  1845. perfectly functioning electronics circuits.  "Engineering by databooks" is
  1846. very common in all types of industries.  It takes less time, costs less
  1847. money, etc.  Why re-invent the wheel?
  1848.  
  1849. Some examples of "typical applications" are:
  1850.  
  1851.     Radio control circuits          Controlling something remotely, or
  1852.                     getting a signal from a remote place
  1853.                     when something happens.
  1854.  
  1855.     DTMF generators                 Generating your own DTMF tones for
  1856.                     telephone communications.
  1857.  
  1858.     Ultrasonic transceivers         Wireless communications.  You could
  1859.                     make a wireless burglar alarm.
  1860.  
  1861.     Speech synthesizers             Verbal communications (e.g. you think
  1862.                     somebody might recognize your voice).
  1863.  
  1864.     Audio amplifiers                Listening to faint conversations.
  1865.  
  1866. The list goes on and on.  Almost anything you can think of has already been
  1867. designed by the engineers that work at these IC companies, although they
  1868. won't be called things like "red box."  Instead they will be called something
  1869. generic (like DTMF tone generators).
  1870.  
  1871. Almost everything I have built was already designed in a databook.  There
  1872. are some exceptions, like radios.  Complex (or semi-complex) things are laid
  1873. out in functional blocks.  A radio will have an RF receiver, a tuner and an
  1874. output amplifier.  So, you just have to hook each of these separate circuits
  1875. together to end up with your final circuit.  [This is actually a poor
  1876. example, but you get the picture.]
  1877.  
  1878.  
  1879. Where can I get these books?
  1880. ============================
  1881.  
  1882. Perhaps the most reliable place to get these books is direct from the IC
  1883. manufacturers.  They have these technical reference books printed up by the
  1884. thousands just for people like you and me.  Sometimes, if you get the right
  1885. person, they will send you a complete set of all their books.
  1886.  
  1887. Another place to find them is at electronics suppliers.  They get tons of
  1888. databooks from the IC manufacturers.  In fact, they often get so many that
  1889. they have to throw some of them out.  Several years ago all of these
  1890. suppliers would hand these books out free.  A friend and I would go around
  1891. to the different suppliers in the area and load up on databooks.  In just a
  1892. few hours, we would have a truck load.  The practice of just handing them
  1893. out is getting increasingly scarce nowadays.  The suppliers feel it's
  1894. another way to make money and so they are starting to charge for them.  But
  1895. not all suppliers do this, so look around and ask.  The easiest way to find
  1896. the suppliers is to look in the yellow pages under:
  1897.  
  1898.     Electronic equipment wholesale & manufacturers
  1899.     Electronic supplies wholesale & manufacturers
  1900.  
  1901. or something similar.  You can also find them by calling the chip
  1902. manufacturers and asking them for local suppliers in your area.
  1903.  
  1904. The last easy place you can find these books is at electronic trade shows.
  1905. Most major cities have them every year or two.  They will usually be in
  1906. some big convention center or arena (the same place they would have home
  1907. shows, boat shows, lawn and garden shows, etc.)  You will probably have to
  1908. do some digging to find out when they are scheduled.  The chip manufacturers
  1909. will set up booths to show off their latest products, and often times they
  1910. will have some sort of "goody" to entice people to stop by their booths.
  1911. These goodies might be key rings, sample parts, or candy but often they are
  1912. databooks.  If they don't have databooks at the show, or if they are all
  1913. gone, you can ask the company representative at the show to send some to
  1914. you.  He will take your name and address and send them out in a few weeks.
  1915.  
  1916.  
  1917. How does one get these books?
  1918. =============================
  1919.  
  1920. It will be easiest to get these reference books if you work for a high-tech
  1921. company or you are in college (or some type of school).  Depending on which
  1922. situation you are in, you can try one of the following:
  1923.  
  1924. If you are with a company, as opposed to school, then your best route would
  1925. be going to an IC manufacturer.  When you get books from them they will
  1926. usually pay the shipping.  To get the books you need to talk with somebody
  1927. in the sales department.  A typical conversation might go like this:
  1928.  
  1929.     IC mfg.         "Hello, blahblahblah IC company."
  1930.  
  1931.     You             "Hi, could I have sales please."
  1932.  
  1933.     IC mfg.         "Just a minute."
  1934.  
  1935.     IC mfg.         "Hello, this is Joe Salesman, can I help you?"
  1936.  
  1937.     You             "Hi Joe, this is John Q. Public with Electro-cool
  1938.             company.  The databooks we have for your company are
  1939.             several years old and I was wondering if you could
  1940.             send me out a new set?"
  1941.  
  1942.     IC mfg.         "Okay.  Can I have your shipping address?"
  1943.  
  1944.     You             "Sure, it's blahblahblah, and could you mark the
  1945.             package 'attention John Q. Public'?"
  1946.  
  1947. Sometimes the salesperson will say that they have to charge for the books. 
  1948. If this happens, just say you are not interested.  Then call back in a few
  1949. days and try to talk with a different person.
  1950.  
  1951. If you are in school, then your best route would probably be a local
  1952. electronics supplier.  But you can try either one regardless of your
  1953. situation.  When you get databooks from a local supplier you will probably
  1954. have to pay for shipping yourself, so your best bet is to just go to their
  1955. place and pick up the books.  Again, you want to talk with somebody in
  1956. sales.  A typical conversation might go like this:
  1957.  
  1958.     Supplier        "Hello, blahblahblah electronics supplier."
  1959.  
  1960.     You             "Hi, could I have sales please?"
  1961.  
  1962.     Supplier        "Just a minute."
  1963.  
  1964.     Supplier        "Hello, this is Joe Salesman.  Can I help you?"
  1965.  
  1966.     You             "Hi Joe, this is John Q. Public at Bigshot
  1967.             University.  I'm working with the electronics lab,
  1968.             and we would like to update our reference books.  Do
  1969.             you guys have any IC databooks?"
  1970.  
  1971.     Supplier        "Yes we do.  We have blahblahblah and so&so."
  1972.  
  1973.     You             "Would it be possible for me to come down and get
  1974.             a few databooks for our lab?"
  1975.  
  1976.     Supplier        "Certainly.  Our address is blahblahblah."
  1977.  
  1978.     You             "All right.  I will come down tomorrow.  Thanks a
  1979.             bunch."
  1980.  
  1981. Now, if these guys want to charge for the books, then you need not call back
  1982. because you will get the same response from everybody there.  Just tell them
  1983. you are not interested.
  1984.  
  1985. If you are getting the databooks from an electronics convention, then just
  1986. act professional and dress nicely, because you will be judged by your
  1987. appearance.  The sales people there are specifically picked to be the
  1988. "suckup" type that wants to please, so you should have no problem.
  1989.  
  1990.  
  1991. Why do they give them away?
  1992. ===========================
  1993.  
  1994. You might be saying to yourself, "This sounds to good to be true, there must
  1995. be a catch or something."  Well, yes and no.  Today, integrated circuits are
  1996. so complex that if you did not have these reference books to help you along
  1997. you would be lost.  There is no way in the world you could figure out how to
  1998. use an IC just by looking at it.  You need to have these technical books to
  1999. do anything.  This being the case, the manufacturers of these chips would
  2000. not be able to sell even one of their chips if an engineer (or technician)
  2001. could not figure out how to use them.  This is why these books are given
  2002. away.  It all has to do with marketing their products.
  2003.  
  2004. Now the catch, they won't just give them to Joe Blow on the street.  They
  2005. must feel there is a potential "sell" somewhere in the future.  In other
  2006. words, there is a marketing strategy behind it.  So most of the time they
  2007. will only give them to people at schools (universities, colleges, technical
  2008. schools, high schools, etc.) or people in high tech industries (software,
  2009. hardware, consumer electronics, research facilities, etc.).  The people in
  2010. these industries and institutions are much more likely to buy these products
  2011. than your average Joe on the street (who would not know how to use these
  2012. reference books let alone buy any of these products).  Since most hackers
  2013. will actually be buying these products, there should not be a problem.
  2014.  
  2015.  
  2016.  
  2017.     Part 2 - Semiconductor Manufacturers
  2018.     ------------------------------------
  2019.  
  2020. Semiconductor manufacturers can provide you with more than just databooks.
  2021. They can also provide you with technical expertise and even free parts. They
  2022. provide all of this in the name of sales.  Since these things help people
  2023. use their products, they are more than happy to do this.
  2024.  
  2025.  
  2026. Getting technical help
  2027. ======================
  2028.  
  2029. IC manufacturers usually have an entire department of engineers to help
  2030. their customers when they are having trouble using their chips.  They can
  2031. walk you through how a circuit works, fax you updated schematics, give you
  2032. ideas on other ways to use their chips, etc.  Say you are trying to make a
  2033. DTMF decoder and you got all the info from the databook, and you put it
  2034. together just right and it still doesn't work.  You can call these guys up
  2035. and ask them for help.  This time when calling, you will want to talk with
  2036. an application engineer instead of a salesperson.  A typical conversation
  2037. might go like this:
  2038.  
  2039.     IC mfg.         "Hello, blahblahblah IC company."
  2040.  
  2041.     You             "Hello.  I'd like to speak to an application
  2042.             engineer, please."
  2043.  
  2044.     IC mfg.         "Just a minute."
  2045.  
  2046.     IC mfg.         "Hi, this is Joe Engineer, can I help you?"
  2047.  
  2048.     You             "Hi Joe, this is John Q. Public with Electro-cool
  2049.             company.  I have been working with your ABC123 DTMF
  2050.             decoder chip and I am having a few problems.  Can
  2051.             you help me?"
  2052.  
  2053.     IC mfg.         "Sure, what kind of problems are you having?"
  2054.  
  2055.     You             "Well, I hooked up the circuit the way your databook
  2056.             said to and it isn't decoding..."
  2057.  
  2058.     IC mfg.         "OK.  Have you checked blahblahblah?"
  2059.  
  2060.     etc...
  2061.  
  2062. These engineers are really a godsend.  They will go out of their way to help
  2063. you.  I have actually had some engineers draw up complete schematics and fax
  2064. them to me.
  2065.  
  2066.  
  2067. Getting free parts
  2068. ==================
  2069.  
  2070. Another thing IC manufacturers will do is provide you with free parts.  OK,
  2071. say you are the entrepreneurial type, and you have designed some kind of
  2072. cool electronic gizmo that you want to sell to "2600" readers, but you are
  2073. not sure if your design will actually work or not.  You can call the IC
  2074. manufacturers and ask them to send you a sample part.  You will need to
  2075. talk with customer support to get sample parts.  A typical conversation
  2076. might go like this:
  2077.  
  2078.     IC mfg.         "Hello, blahblahblah IC company."
  2079.  
  2080.     You             "Hi.  Can I have customer support?"
  2081.  
  2082.     IC mfg.         "Just a minute."
  2083.  
  2084.     IC mfg.         "Hi, this is Joe Supportperson.  Can I help you?"
  2085.  
  2086.     You             "Hi Joe, this is John Q. Public with Electro-cool
  2087.             company.  I am doing a little research project with
  2088.             DTMF decoders and I was hoping you could send me a
  2089.             sample ABC123 chip so I can verify if the project is
  2090.             viable or not.  I just need one to verify the 
  2091.             circuit design."
  2092.  
  2093.     IC mfg.         "Sure, where would you like it sent?"
  2094.  
  2095.     You             "Send it to Electro-cool company at blahblahblah.
  2096.             And could you mark it 'attention John Q. Public'?"
  2097.  
  2098.     IC mfg.         "No problem.  You should have it in a couple of
  2099.             days."
  2100.  
  2101. Some other situations in which you could get sample parts is if you need
  2102. just one chip and you can't find anybody to sell you just one, or if you
  2103. can't find the chip from any supplier, anywhere.  Just call the manufacturer
  2104. and ask them for a sample.  Most likely they will help you.  This practice
  2105. of sampling parts is very common in the electronics industry.  Again, it all
  2106. has to do with marketing, sales, and customer satisfaction.
  2107.  
  2108.  
  2109. A final note about dealing with semiconductor manufacturers
  2110. ===========================================================
  2111.  
  2112. Many times when you call and ask for specific departments the receptionist
  2113. will ask "for what product, sir"?  Just tell them "ICs."  Also, when you
  2114. ask for sample parts you may be asked a few questions about how many you
  2115. might purchase in the future.  Because I work in a research department I
  2116. tell them "I have no idea.  It depends on the project making it out of the
  2117. research stage."  Also, remember to be courteous--these people are helping
  2118. you.
  2119.  
  2120.  
  2121. Additional References
  2122. =====================
  2123.  
  2124.  
  2125. Semiconductor suppliers
  2126. -----------------------
  2127.  
  2128. The following companies will sell electronic parts to anybody (i.e. you
  2129. don't need to be working for a high-tech company or going to school).
  2130. You can call these companies and get their catalogs, free.  As well
  2131. as describing the products they sell, these catalogs have some useful
  2132. information in them.
  2133.  
  2134.     Digi-Key Corporation
  2135.     701 Brooks Ave. South, P.O. Box 677
  2136.     Thief River Falls,   MN  56701-0677  USA
  2137.     TELEPHONE: 800-344-4539
  2138.     FAX:       218-681-3380 FAX
  2139.     OTHER:     800-344-4539
  2140.  
  2141.     Mouser Electronics
  2142.     24-T Hwy. 287 N., P.O. Box 719
  2143.     Mansfield,   TX  76063  USA
  2144.     TELEPHONE: 817-483-4422
  2145.     FAX:       817-483-0931 FAX
  2146.     OTHER:     800-346-6873
  2147.     TELEX II4   510-601-0375 TWX
  2148.  
  2149.  
  2150. Semiconductor manufacturers
  2151. ---------------------------
  2152.  
  2153. Here is a list of some of the more common semiconductor manufacturers.
  2154.  
  2155.  
  2156.     Advanced Micro Devices, Inc.
  2157.     One AMD Place, P.O. Box 3453
  2158.     Sunnyvale,   CA  94088-3453  USA
  2159.     TELEPHONE: 408-732-2400
  2160.  
  2161.     Intel Corp.
  2162.     3065-T Bowers Ave.
  2163.     Santa Clara,   CA  95052-8121  USA
  2164.     TELEPHONE: 408-765-8080
  2165.     OTHER:  800-548-4725
  2166.  
  2167.     Motorola, Inc., Semiconductor Products Sector
  2168.     3102-T N. 56th St.
  2169.     Phoenix,        AZ  85018  USA
  2170.     TELEPHONE: 602-952-3248
  2171.     FAX:    602-952-6100 FAX
  2172.  
  2173.     National Semiconductor Corp.
  2174.     2900 Semiconductor Dr., P.O. Box 58090
  2175.     Santa Clara,   CA  95052-8090  USA
  2176.     TELEPHONE: 408-721-5000
  2177.     FAX:    408-739-9803
  2178.     OTHER:  800-272-9959
  2179.         910-339-9240 TWX
  2180.  
  2181.     NEC Electronics Inc.
  2182.     401-T Ellis St., P.O. Box 7241
  2183.     Mountain View,   CA  94039  USA
  2184.     TELEPHONE: 415-960-6000
  2185.     FAX:    800-729-9288 FAX
  2186.     OTHER:  800-632-3531
  2187.  
  2188.     SGS-Thomson Microelectronics Inc.
  2189.     1310-T Electronics Dr.
  2190.     Carrollton,   TX  75006  USA
  2191.     TELEPHONE: 214-466-6000
  2192.     FAX:    214-466-6572 FAX
  2193.  
  2194.     Siemens Components Inc., Integrated Circuit Div.
  2195.     10950 N. Tantan Ave.
  2196.     Cupertino,   CA  95014  USA
  2197.     TELEPHONE: 408-777-4500
  2198.     FAX:    408-777-4977 FAX
  2199.     OTHER:  800-338-2777
  2200.  
  2201.     Texas Instruments, Inc.
  2202.     P.O. Box 255012, M.S. 57
  2203.     Dallas,   TX  75265-5012  USA
  2204.     TELEPHONE: 214-995-2011
  2205.     FAX:    214-995-4360 FAX
  2206.     OTHER:  800-336-5236
  2207.  
  2208.  
  2209.  
  2210.  
  2211.             Ways how to help keep your privacy
  2212.                     by Deliryum
  2213.  
  2214.  
  2215.  Privacy. Its something that all of us should strive to obtain. Not because
  2216. we feel we have something to hide, but becuase we have something to protect.
  2217. The world in which we live today is not exactly a friendly place to be anymore.
  2218. Crime is all around us; Though no longer are the lines so very well drawn
  2219. as to who are the criminals and who are your friends as they may have been in
  2220. past times. Our neighbors, police, even our very government could possiblly
  2221. turn out to be our worse enemies. Is this just idle paranoia or something
  2222. quite sinister and *very* real? Take a long hard look at the world today
  2223. folks and that question should be easy to answer.
  2224.  
  2225.  Below are various things you can do to help maintain your privacy. Although
  2226.  there are no garrantees of *total* privacy, these procedures will certainly
  2227.  help secure your privacy to a greater degree than most.
  2228.  
  2229. Do your best to stay away from trouble with the law. They like information
  2230. about people and will do practically anything to get it. Keep your record as
  2231. clean as possible.  If you do get in trouble with them do not say anything. You
  2232. are under no obligation to talk to them. Make sure your attorney is present if
  2233. you do however. If you say nothing that will incriminate you or others then that
  2234. will make it that much harder on them to screw you over. This cannot be stressed
  2235. enough! Believe it, live it, follow it.
  2236.  
  2237. Never tell strangers where you work. Always give fake info on this. Tell
  2238. them that you are self employed, aren't employed, etc etc... If you are paid by
  2239. check, DON'T deposit the paycheck into a bank account that has any bearing
  2240. upon you. Such as one that has your name as the owner of said account.. :) The
  2241. best measure as to cashing the check would be to go to the bank whose name is
  2242. printed upon the check. Never make a regular schedule of cashing your checks as
  2243. this might allow a cashier/other bank employee the ability to recognise you as
  2244. you would be a "regular". Habits of such would be one of the first things a
  2245. person might check out to get information on you. Also, on the subject of jobs,
  2246. you should watch what info you give about yourself to other workers.
  2247.  
  2248. Also in dealing with strangers and people that you really don't know on a very
  2249. personal level in general be wary of what you say pertaining to yourself. The
  2250. less you tell of yourself, the harder you make it on potential "snoops". The
  2251. popular phrase from the X-files show of "trust no one" is the key mindset
  2252. here.
  2253.  
  2254. In your finacial dealings, try to stick to cash. Cash leaves no paper trail
  2255. and is practically impossible to trace in itself. If you can't use cash as in
  2256. the case of mail order use money orders as they are hard to trace whereas
  2257. checks are quite traceable. In the case of mail order items, always have them
  2258. sent to a "drop site". This should not be a post office box either. This
  2259. rule should apply to all mail in general for that matter. Also on that
  2260. subject, when sending US mail never put your address on the outside of the
  2261. letter.
  2262.  
  2263. When dealing with US mail use a typewriter/printer to make out the letter.
  2264. Handwriting can be traced back to you should a test be preformed upon samples.
  2265. After typing the letter out make a copy of it via a copy machine and mail the
  2266. copy. Destroy the original. This will make it next to impossible to trace the
  2267. letter back to a particular machine. When using E-mail always encrypt any
  2268. sensitive information. Please refer to Daemon9's article once again if you
  2269. have not in this issue of IC.
  2270.  
  2271. Do your best to keep secret the names of your friends/family. Also, always
  2272. tell your friends/family NEVER EVER EVER to give out information concerning
  2273. you. This being phone numbers, addresses, etc etc etc... Make sure you are
  2274. quite adamanate about this!
  2275.  
  2276. Keep your home in such a manner that it would not draw un-needed attention.
  2277. In this I mean don't throw large parties that would get the notice of your
  2278. pesky ass neighbors. Keep your music low. Keep your yard clean and well mowed.
  2279. Keep yourself in a likewise manner. By this I mean do not behave in a way that
  2280. is "unacceptable" to the community at large. This will draw attention to
  2281. yourself from others as they will think you are "strange". I know this may be
  2282. a stretch for most of you (myself included in this.. heh ). Also, do not be
  2283. "unfriendly" to people, but make sure you are not overly friendly either. To
  2284. do so either way will bring attention to yourself. To keep them from taking an
  2285. interest in you, so to speak, act like them, talk like them, be like them. Like
  2286. they say... when in Rome... do like the Romans... :)
  2287.  
  2288.  When going to a doctor or such try not to use your real name if you possibly
  2289. can. By this I mean, if you can afford it (that meaning that you can pay in
  2290. cash for the services provided) give a fake name and address on any forms you
  2291. are given. Fake id should be a definate must in these cases as they are most
  2292. likely going to request some form of id or another. This advice should go for
  2293. pharacists as well if you are needing to have medicine filled.
  2294.  
  2295. Do not affiliate your self in groups or clubs. Such being *any* politically
  2296. active group, Kiwanas club, PTA, Militias (heh), etc etc etc... Keep to
  2297. yourself on your views concerning "controversial" subjects to yourself. Siding
  2298. with such groups will most certainly draw attention to yourself by someone.
  2299.  
  2300. Avoid being fingerprinted. Many jobs ask that thier employees be fingerprinted
  2301. for id purposes... Don't allow this to be done on you. Several times a year tv
  2302. ads will come out about how a person should be finger printed with the fbi so
  2303. if they end up missing the fbi can help search for the missing person, etc
  2304. etc.. well while that might be a big help in finding a lost loved one it also
  2305. helps to kill your personal privacy as that will be entered in the NCIC. In
  2306. other words, don't let them print ya. :) In the case of legal trouble when
  2307. they are ganna print ya whether you like it or not have your lawyer file for
  2308. expungement of your records after your trial/payment of fees. Its ganna cost
  2309. ya (believe me.. it will), but expungment will order by the courts that all
  2310. records pertaining to your case be destroyed. In other words, as far as the
  2311. law is concerning.. the crime was never took place. A clean record is a good
  2312. thing too... heh
  2313.  
  2314. To start off you should stop attending church. For the most part, church ppl
  2315. are some of the nosiest people around. It seems like they want to know
  2316. everthing about you and will gossip like crazy about you. If you are that
  2317. devoutly religeous and value that over your privacy you should change the
  2318. church that you currently attend and use another name at the new church. Also,
  2319. speaking of which you should give false information about yourself concerning
  2320. everything related your attendance of that church. In other words, if you are
  2321. asked where you live give a fake address. Basically bullshit info to anything
  2322. relating to "you" at that particular church. if you give to the offering box
  2323. give in cash. Do not use a check. A paper trail is quite easy to trace. If you
  2324. are asked by someone (neighbor, whomever) of the name of the church you attend
  2325. you should give the name of another church than the faith of the one that you
  2326. attend or just tell them that you do not attend at all. Do NOT let them talk
  2327. you into going to thier church. Once again I stress you should really stop
  2328. attending church as this will enhance your privacy.
  2329.  
  2330. Avoid getting yourself into a "routine". Most of us fall victim to this. We do
  2331. things a certain way and manner. Such as driving to and from work. We normally
  2332. alway take the same route. Vary the ways in which you do things. Habits mark
  2333. us and thus can be used against us.
  2334.  
  2335. When making phone calls, NEVER dial 1-800 numbers or any other number that has
  2336. ANI capabilites from your house... ie.. 911 (well, only if you have to from your
  2337. phone), 1-900's, etc etc... They will have the number you are at if you do.
  2338. Also, concerning your phone bill ask the phone company what you can do to make
  2339. your line more private. Block out caller id, have an unlisted number, have it
  2340. where your information is flagged where it can't be given out to the LD
  2341. companies such as at&t and the like, etc etc... Also request that a passcode
  2342. be put on your bill with them and have that passcode be used for *ALL* trans-
  2343. actions concerning your account with them. Such as phone canceling, changing of
  2344. status of the line, etc etc...
  2345.  
  2346. Finally, when disposing of "sensitive" information make sure you rend it so it
  2347. cannot be recovered. In the case of electronic data, one should encrypt it with
  2348. such a program as PGP, wipe (not erase) it, and then possibly (if its VERY
  2349. sensitive) run a defrag on your harddrive as well. This should make it
  2350. impossible for a recovery. In the case of "physical" items, such as US mail,
  2351. documents, disks, etc...shreading is a good idea followed by burning the remains
  2352. and then scattering them. Remeber police agencies need no warrent to search
  2353. your trash. Keep this in mind. Paranoia is a good thing.
  2354.  
  2355.  While there is no sure fire way to completly remaining anonymous short of
  2356.  completly revamping your identity, the above measures will greatly enhance
  2357.  the level of your personal privacy. Well, this about does it for me. Take
  2358.  care folks and always watch your backs. You never know who may be back there
  2359.  waiting with the proverbial knife... :)
  2360.  
  2361.  
  2362.                        
  2363.          Deliryum
  2364.  
  2365.                   .oO____Oo.
  2366.  
  2367.  
  2368.  
  2369.  
  2370. _+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_ 
  2371. +  Mythrandir's Greetings and such  +     
  2372. _+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_+_  
  2373.  
  2374. A special hi and hello to all those who have touched my life:
  2375.  
  2376. Dexter - If this ever finds its way to you, GO to my family's house
  2377.      and get my phone number and use that wonderful tool called the
  2378.      phone.  As you said, We have much to talk about.
  2379.  
  2380. ReDragon - The man who made me feel special when he said things like, 
  2381.        Mythrandir is the first person to come on #hack in a long
  2382.        time that was a complete and utter idiot. (perhaps the word wasn't
  2383.        idiot), and JUST THE OTHER DAY I WAS THINKING TO MYSELF WTF
  2384.        HAPPENED TO MYTHRANDR.  Now, how can you not love this guy?
  2385.  
  2386. Zem - The guy who was working right along with me, when I rediscovered computer
  2387.       hacking.  It was a fine night of delving into the network around us.  
  2388.       Also, the creator of probably the most unique application the guild 
  2389.       will ever receive.
  2390.  
  2391. Tim - Me TIM at DEFCON.  All I have to say is, thanks Tim! You've done
  2392.       so much good, and you don't even realize it.
  2393.  
  2394.  
  2395.  
  2396. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2397. = Obtaining Information on Other People =
  2398. - By,                                   -
  2399. =    Mythrandir                         =
  2400. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2401.  
  2402.  
  2403. Recently, I was given a copy of a post to alt.privacy which dealt
  2404. with the acquiring of knowledge through public records.  I found the
  2405. subject very interesting so I decided to look into it.  As luck would have
  2406. it I found two interesting books on the subject in the reference section
  2407. at a bookstore down at my college.  I read through these two books,
  2408. and found that obtaining information on another individual was
  2409. very easy.  The two books I purchased were
  2410.  
  2411. Researching Public Records by Vincent Parco and published by Citadel Press
  2412. under the Learning Annex books series.  The ISBN is 0-8065-1522-8
  2413. The book cost me $8.95.
  2414.  
  2415. Private Investigating Made Easy by Kelly E. Riddle and published by 
  2416. Historical Publications.  The ISBN is 1-881825-05-1 
  2417. The book cost me $12.95.
  2418.  
  2419. This article documents the general information that I gained while reading
  2420. these books.  If you wish more detail and pointers to resources, I 
  2421. recommend picking these books up.
  2422.  
  2423. First off, it is entirely legal to use public records for investigation
  2424. of another individual. However, you must obtain a liscense in order
  2425. to investigate for money.  
  2426.  
  2427. If you are trying to obtain information on a person, you should first detail
  2428. exactly what you know and what you are trying to find out.
  2429. The basic information that you should try to collect (and the more
  2430. you have the easier your search will be) is..
  2431.  
  2432. Name (full name) - When doing searches be sure to search on all possible
  2433.     variations of a name.  If a persons name is Timothy X. you should also
  2434.     search under Tim X. 
  2435.  
  2436. Birth Date - This is needed to access some records.
  2437.  
  2438. Social Security Number - Again some records are searched by this number.
  2439.  
  2440. Address - This is mostly useful in order to find a person
  2441.  
  2442. Phone Number - Useful to have so you can call, and obtain more information
  2443.     through social engineering.  Or you can just have a nice chat with
  2444.     the person you are trying to obtain information about.
  2445.  
  2446. Description - Helpful in determining who a person is if you do not have a lot
  2447.     of the above information.
  2448.  
  2449. Occupation - Also useful in finding a person as well as determining the
  2450.     financial position of your subject.
  2451.  
  2452. Of course there are many other things that you can find out about a person,
  2453. but the above are very useful in tracking down someone and after
  2454. that you can do what you will.
  2455.  
  2456.     So how do you obtain this information? Well, it is very easy.  Two of the
  2457. best places to start are the Board of Elections and the good ole DMV.
  2458.  
  2459.     In order to do a search at the board of elections you need to have a list 
  2460. of names that you are searching for.  A birth date or approximate 
  2461. birthdate can also be helpful. The board of elections holds voter registration
  2462. records that you can access.  These records will allow you to verify a 
  2463. persons name, when they were born, a general description, their current
  2464. address, how long they have lived there, immigration status, and politcal party.
  2465. It is also possible for you to obtain their phone number if they recorded
  2466. it in an optional field.  As you can see this one stop is very useful for
  2467. obtaining plenty of information.  There is of course one hitch, they must
  2468. have registered to vote.
  2469.  
  2470.     So the board of elections doesn't turn up anything.  Well, chances are
  2471. the subject drives.  So off to the DMV you go.  In order to do a search at
  2472. the DMV you need a full name, birthdate, and possibly a drivers liscense
  2473. number (but not always).  Also, you need to call the appropriate DMV
  2474. for which state you are searching.  The DMV holds drivers registration
  2475. information.  This will get you the persons full name, birth date,
  2476. their driving record, date liscense issued and when it expires, 
  2477. and any restrictions the subject has on driving.
  2478.  
  2479.     Also, if you are searching by liscense plate you can obtain the
  2480. full name of the owner of a vehicle (not necessarily the driver), the
  2481. vehicle identification number, year and model of the vehicle, insurance
  2482. company, registration and expiration, lien holder, and the color of
  2483. the vehicle.  All useful information as well.
  2484.  
  2485. Well, at this point you have probably already ammased quite a bit of
  2486. information. But suppose you are trying to find a person, and they
  2487. are not living at the address that is listed on their drivers liscense.
  2488. At this point you should head on over to the post office and fill out
  2489. a freedom of information act form requesting the forwarding address of
  2490. an individual.  You need the persons name and last place of residence.
  2491. This will usually work if someone filled out a mail forwarding card when
  2492. they moved.  However, it is possible for the subject to request that the
  2493. information not be given out by paying a small fee. (So for future reference,
  2494. if you move, ask about this option and pay the few dollars for your privacy)
  2495.  
  2496. Other places to obtain information is the County Courthouse where
  2497. you can obtain Criminal recordes, civil records (divorces, debts..) ,
  2498. birth records, marriage liscenses, death records, and many other
  2499. pieces of information.  One useful search is to see if the subject owns
  2500. any businesses.
  2501.  
  2502. A little investigation into these areas should yield tremendous results.
  2503. If you have any questions about searching records or need any help
  2504. please feel free to contact me at jwthomp@uiuc.edu
  2505.  
  2506. Best of luck,
  2507.  
  2508. Mythrandir 
  2509.  
  2510. P.S. I intentionally did not go into full detail with this, but felt
  2511.     it was better to just lay down the basics to allow people to explore 
  2512.     this.  I am certain that you will find all of your endeavors fruitful
  2513.     and very interesting.
  2514.  
  2515.  
  2516.  
  2517.  
  2518.                   .oO____Oo.
  2519.  
  2520.  
  2521.  
  2522. ----------------------------------------------------
  2523. +           Linux Network Sniffing                 +
  2524. ----------------------------------------------------
  2525.  
  2526. The following file that I have included is a basic
  2527. network sniffer that will run on linux boxes.  It
  2528. is very easy to port it over to other platforms as
  2529. all you have to do is rewrite the network code section.
  2530.  
  2531. inet.h - contains all of the includes for the networking
  2532.      code to work.
  2533.  
  2534. globals.h - contains one global definition.. Perhaps later
  2535.         I'll add another.
  2536.  
  2537. packet.h - contains the definitions for the packets.
  2538.        Currently only tcp/ip is supported.
  2539.  
  2540.        struct PACKET will hold one packet
  2541.        struct CONNECTION defines a unique connection pair
  2542.  
  2543. find.h & .c - contain the code for a very simple pattern matching
  2544.           algorithm.
  2545.  
  2546. sniff.c - contains the bulk of the sniffer code
  2547.  
  2548. sniff.h - contains the definitions for sniff.c. 
  2549.       init - initializes the network interface.
  2550.          This will need to be modified if this is ported 
  2551.          to a new platform.
  2552.  
  2553.       Get_Packet - grabs a packet from the network
  2554.                This will also have to be modified if a port is
  2555.                attempted.
  2556.      
  2557.       Convert_Packet - converts the raw char string buffer 
  2558.          into a struct PACKET.  This should be modified
  2559.          in the future to check for what type of
  2560.          packet it is.. i.e. tcp/ip, tcp/udp, IPX.. 
  2561.  
  2562.       Set_Connection - Defines the values for a unique connection pair
  2563.                into struct CONNECTION
  2564.  
  2565.       Write_Data - Merely outputs the data portion of a PACKET onto the
  2566.                screen
  2567.  
  2568.       Display_Connections - Displays a list of unique connections from
  2569.                 an array of CONNECTIONS.. Not very eligant.
  2570.  
  2571.       Data_Length - Returns the length of the data portion of a PACKET
  2572.  
  2573. main.c - Contains the main loop, that utilizes this code.  In its present
  2574.      form it captures all packets that traverse lo (loopback) and
  2575.      display them on the screen... If you would like to watch another
  2576.      interface change the name string to another interface, such as 
  2577.      eth0..
  2578.  
  2579.     I have modified this program to act as a password sniffer, but have not
  2580. included it as it is still far to rough looking (yes even in comparison to this).
  2581. I will however, release it as soon as I am happy with it.  I also plan to 
  2582. release an updated version of this sniffer that will check for packet type
  2583. and print out the appropriate type.
  2584.  
  2585.     Even though this code is rough, it should be very easy for someone to
  2586. rip apart and play with.  I am interested to hear of anything anyone does
  2587. with it, and as always am more than willing to help out or to answer questions.
  2588.  
  2589. - Mythrandir
  2590.  
  2591. The following is a shell archive of the code.  Create a directory
  2592. and place this in it as sniff.shar  Then type sh sniff.shar and it
  2593. will self extract.
  2594.  
  2595. #!/bin/sh
  2596. # shar: Shell Archiver  (v1.22)
  2597. #
  2598. #       Run the following text with /bin/sh to create:
  2599. #         OUT
  2600. #         README
  2601. #         find.c
  2602. #         find.h
  2603. #         globals.h
  2604. #         inet.h
  2605. #         main.c
  2606. #         packet.h
  2607. #         sniff.c
  2608. #         sniff.h
  2609. #
  2610. sed 's/^X//' << 'SHAR_EOF' > OUT &&
  2611. SHAR_EOF
  2612. chmod 0644 OUT || echo "restore of OUT fails"
  2613. sed 's/^X//' << 'SHAR_EOF' > README &&
  2614. XTo compile on a Linux box type
  2615. Xgcc -o Sniff find.c main.c sniff.c
  2616. X
  2617. XEnjoy,
  2618. X
  2619. XMythrandir
  2620. SHAR_EOF
  2621. chmod 0644 README || echo "restore of README fails"
  2622. sed 's/^X//' << 'SHAR_EOF' > find.c &&
  2623. X#include <string.h>
  2624. X
  2625. Xint Find(char * String, char * Match, int length2)
  2626. X{
  2627. Xint length;
  2628. Xint i, k;
  2629. Xchar buf[100];
  2630. X
  2631. Xlength = strlen(Match);
  2632. X
  2633. Xif(length2 < length)
  2634. X    return 0;
  2635. X
  2636. Xfor(i = 0; i < (length2 - length); i++)
  2637. X    {
  2638. X    for(k = 0; k < length; k++)
  2639. X        buf[k] = String[k + i];
  2640. X    if(!strncmp(buf,Match,length))
  2641. X        return 1;
  2642. X    }
  2643. X
  2644. Xreturn 0;
  2645. X}
  2646. SHAR_EOF
  2647. chmod 0644 find.c || echo "restore of find.c fails"
  2648. sed 's/^X//' << 'SHAR_EOF' > find.h &&
  2649. Xint Find(char * String, char * Match, int);
  2650. SHAR_EOF
  2651. chmod 0644 find.h || echo "restore of find.h fails"
  2652. sed 's/^X//' << 'SHAR_EOF' > globals.h &&
  2653. X#define PACKET_LENGTH 500
  2654. X
  2655. X
  2656. X
  2657. SHAR_EOF
  2658. chmod 0644 globals.h || echo "restore of globals.h fails"
  2659. sed 's/^X//' << 'SHAR_EOF' > inet.h &&
  2660. X#ifndef INET
  2661. X#define INET
  2662. X
  2663. X#include <stdio.h>
  2664. X#include <string.h>
  2665. X#include <unistd.h>
  2666. X#include <stdlib.h>
  2667. X
  2668. X#include <sys/ioctl.h>
  2669. X#include <sys/types.h>
  2670. X#include <sys/socket.h>
  2671. X#include <netinet/in.h>
  2672. X#include <arpa/inet.h>
  2673. X
  2674. X#include <linux/inet.h>
  2675. X#include <linux/in.h>
  2676. X#include <linux/types.h>
  2677. X#include <linux/socket.h>
  2678. X
  2679. X
  2680. Xchar *pname;
  2681. X
  2682. X#endif
  2683. SHAR_EOF
  2684. chmod 0644 inet.h || echo "restore of inet.h fails"
  2685. sed 's/^X//' << 'SHAR_EOF' > main.c &&
  2686. X#include "sniff.h"
  2687. X#include "inet.h"
  2688. X#include "find.h"
  2689. X
  2690. X#include <string.h>
  2691. X
  2692. Xvoid main()
  2693. X{
  2694. XFILE * fd;
  2695. Xint i,j;
  2696. Xint choice;
  2697. Xchar name[2];
  2698. Xchar buf[500];
  2699. Xstruct PACKET *Out;
  2700. Xstruct CONNECTION List[256];
  2701. Xchar View[256][50];
  2702. Xchar Data[256][50];
  2703. Xstruct CONNECTION Check[1];
  2704. Xint toggle = 0;
  2705. Xint count = 0;   /* Stores the number of unique connections */
  2706. X
  2707. Xstrncpy(name, "lo\0", 3);
  2708. X
  2709. Xinit(name);
  2710. X
  2711. Xwhile(1)
  2712. X    {
  2713. X
  2714. X    /*
  2715. X     * Get the next packet to fly by the network
  2716. X     */
  2717. X    Get_Packet(buf);
  2718. X
  2719. X    /*
  2720. X     * Convert the buffer into a Packet type structure
  2721. X     */
  2722. X    Out = Convert_Packet(buf);
  2723. X
  2724. X    /*
  2725. X     * Display all of the packet information
  2726. X     */
  2727. X    Display_Packet(Out); 
  2728. X
  2729. X    /* 
  2730. X     * If the program detects login in the text it will then check
  2731. X     * if the connection is unique
  2732. X     */
  2733. X        if(Unique(List, Out, count) == -1)
  2734. X            {
  2735. X            printf("Found a Unique connection\n");
  2736. X            count = count + 1;
  2737. X            Display_Connections(List, count);
  2738. X            }
  2739. X
  2740. X    }
  2741. X}
  2742. SHAR_EOF
  2743. chmod 0644 main.c || echo "restore of main.c fails"
  2744. sed 's/^X//' << 'SHAR_EOF' > packet.h &&
  2745. X#include "globals.h"
  2746. X
  2747. X
  2748. X
  2749. X
  2750. Xstruct iphdr {
  2751. X    unsigned char version;
  2752. X    unsigned char tos;
  2753. X    unsigned char tot_len[2];
  2754. X    unsigned char id[2];
  2755. X    unsigned char frag_off[2];
  2756. X    unsigned char ttl;
  2757. X    unsigned char protocol;
  2758. X    unsigned char check[2];
  2759. X    unsigned char saddr[4];
  2760. X    unsigned char daddr[4];
  2761. X    };
  2762. X
  2763. Xstruct tcphdr {
  2764. X    unsigned char source[2];
  2765. X    unsigned char dest[2];
  2766. X    unsigned char seq[4];
  2767. X    unsigned char ack_seq[4];
  2768. X    unsigned char flags[2]; 
  2769. X    unsigned char window[2];
  2770. X    unsigned char check[2];
  2771. X    unsigned char urg_ptr[2];
  2772. X    };
  2773. X
  2774. X/*
  2775. X * A structure which contains all of the parts of a packet
  2776. X */
  2777. X
  2778. Xstruct PACKET {
  2779. X    struct iphdr IP;
  2780. X    struct tcphdr TCP;
  2781. X    char DATA[PACKET_LENGTH];
  2782. X    }; 
  2783. X
  2784. Xstruct CONNECTION {
  2785. X    unsigned char protocol;
  2786. X    unsigned char saddr[4];
  2787. X    unsigned char daddr[4];
  2788. X    unsigned char source[2];
  2789. X    unsigned char dest[2];
  2790. X    unsigned char seq[4];
  2791. X    unsigned char ack_seq[4];
  2792. X    };
  2793. X    
  2794. X    
  2795. SHAR_EOF
  2796. chmod 0644 packet.h || echo "restore of packet.h fails"
  2797. sed 's/^X//' << 'SHAR_EOF' > sniff.c &&
  2798. X#include <linux/if_ether.h>
  2799. X#include <linux/if.h>
  2800. X#include <string.h>
  2801. X
  2802. X#include "inet.h"
  2803. X#include "sniff.h"
  2804. X#include "globals.h" 
  2805. X
  2806. X/* Globals */
  2807. X
  2808. X
  2809. X
  2810. Xint Sock;
  2811. Xstruct ifreq oldifr, ifr;
  2812. X
  2813. Xvoid init(char * DEV)
  2814. X{
  2815. X
  2816. XSock = socket(AF_INET, SOCK_PACKET, htons(ETH_P_ALL));
  2817. X
  2818. X/*
  2819. X * Stores device name to access in ifr and oldifr
  2820. X */
  2821. Xstrcpy(ifr.ifr_name, DEV);
  2822. Xstrcpy(oldifr.ifr_name, DEV);
  2823. X
  2824. X/*
  2825. X * Stores the cards current setting into ifr and oldifr
  2826. X */
  2827. Xif(ioctl(Sock, SIOCGIFFLAGS, &ifr) < 0)
  2828. X    {
  2829. X    printf("Unable to get %s flags.\n", DEV);
  2830. X    exit(1);
  2831. X    }
  2832. X
  2833. Xif(ioctl(Sock, SIOCGIFFLAGS, &oldifr) < 0)
  2834. X    {
  2835. X    printf("Unable to get %s flags.\n", DEV);
  2836. X    exit(1);
  2837. X    }
  2838. X
  2839. X/*
  2840. X * Sets ifr's flags to include Promiscuous Mode
  2841. X */
  2842. Xifr.ifr_flags |= IFF_PROMISC;
  2843. X
  2844. X/*
  2845. X * Sets devices flags to that of ifr's
  2846. X */
  2847. Xif(ioctl(Sock, SIOCSIFFLAGS, &ifr) < 0)
  2848. X    {
  2849. X    printf("Unable to set %s flags.\n", DEV);
  2850. X    exit(1);
  2851. X    }
  2852. Xprintf("%s device has been successfully configured.\n", DEV);
  2853. X}
  2854. X
  2855. Xvoid Get_Packet(char buf[PACKET_LENGTH])
  2856. X{
  2857. Xint length;
  2858. Xstruct sockaddr saddr;   
  2859. Xint sizeaddr;
  2860. X
  2861. Xlength = recvfrom(Sock, buf, PACKET_LENGTH, 0, &saddr, &sizeaddr);
  2862. X
  2863. X
  2864. X}
  2865. X
  2866. Xstruct PACKET * Convert_Packet(char buf[PACKET_LENGTH])
  2867. X{
  2868. Xint i;
  2869. Xchar tmp[PACKET_LENGTH];
  2870. Xstruct PACKET Holder;
  2871. X
  2872. X/* 
  2873. X * Copy over ip information
  2874. X */
  2875. Xfor(i = 14; i < 34; i++)
  2876. X    tmp[i - 14] = buf[i];
  2877. X/*
  2878. X * Copy tmp to iphdr structure 
  2879. X */
  2880. Xbcopy(tmp, &Holder.IP, 20);
  2881. X
  2882. X/* 
  2883. X * Copy over tcp information
  2884. X */
  2885. Xfor(i = 34; i < 54; i++)
  2886. X    tmp[i - 34] = buf[i];
  2887. Xbcopy(tmp, &Holder.TCP, 20);
  2888. X
  2889. Xfor(i = 54; i < PACKET_LENGTH; i++)
  2890. X    tmp[i - 54] = buf[i];
  2891. Xbcopy(tmp, &Holder.DATA, (PACKET_LENGTH - 54));
  2892. X
  2893. Xreturn &Holder;
  2894. X}
  2895. X
  2896. Xvoid Display_Packet(struct PACKET * Out)
  2897. X{
  2898. Xint i,k;      /* loop variables */
  2899. Xint dlength;
  2900. X
  2901. X
  2902. X
  2903. X/*
  2904. X * Display ip Information
  2905. X */
  2906. Xprintf("Header Length: %d   Service Type: %d",
  2907. X        Out->IP.version & 0x000f, Out->IP.tos & 0x00ff);
  2908. Xprintf("    Total Length: %d\n", 
  2909. X        (Out->IP.tot_len[0] & 0x00ff) * 256 + (Out->IP.tot_len[1] & 0x00ff));
  2910. Xprintf("Id: %d    FragFlags: %d\n",
  2911. X        (Out->IP.id[0] & 0x00ff) * 256 + (Out->IP.id[1] & 0x00ff),
  2912. X        (Out->IP.frag_off[0] & 0x00ff) * 256 + (Out->IP.frag_off[1] & 0x00ff));
  2913. Xprintf("TTL: %d    Protocol: %d    HeaderChecksum: %d\n", 
  2914. X        Out->IP.ttl & 0x00ff, Out->IP.protocol & 0x00ff,
  2915. X        (Out->IP.check[0] & 0x00ff) * 256 + (Out->IP.check[1] & 0x00ff));
  2916. Xprintf("Source Address: %d.%d.%d.%d    Destination Address: %d.%d.%d.%d\n",
  2917. X        Out->IP.saddr[0] & 0x00ff, Out->IP.saddr[1] & 0x00ff, 
  2918. X        Out->IP.saddr[2] & 0x00ff, Out->IP.saddr[3] & 0x00ff, 
  2919. X        Out->IP.daddr[0] & 0x00ff, Out->IP.daddr[1] & 0x00ff, 
  2920. X        Out->IP.daddr[2] & 0x00ff, Out->IP.daddr[3] & 0x00ff); 
  2921. X
  2922. X/*
  2923. X * Display tcp information
  2924. X */
  2925. X
  2926. Xprintf("Source Port: %d    Destination Port: %d\n",
  2927. X        ((Out->TCP.source[0] & 0x00ff) * 256) + (Out->TCP.source[1] & 0x00ff),
  2928. X        ((Out->TCP.dest[0] & 0x00ff) * 256) + (Out->TCP.dest[1] & 0x00ff));
  2929. Xprintf("Sequence Number: %ld    Acknowledgement Number: %ld\n",
  2930. X        (Out->TCP.seq[0] & 0x00ff) * 65536 + (Out->TCP.seq[1] & 0x00ff) * 4096
  2931. X        + (Out->TCP.seq[2] & 0x00ff) * 256 + (Out->TCP.seq[3] & 0x00ff),
  2932. X        (Out->TCP.ack_seq[0] & 0x00ff) * 65536 + (Out->TCP.ack_seq[1] & 0x00ff) * 4096
  2933. X        + (Out->TCP.ack_seq[2] & 0x00ff) * 256 + (Out->TCP.ack_seq[3] & 0x00ff));
  2934. Xprintf("TCP Header length: %d    Checksum: %d    Urgent Pointer: %d\n",
  2935. X        (Out->TCP.flags[0] & 0x00f0) >> 4, (Out->TCP.check[0] & 0x00ff) * 256 +
  2936. X        (Out->TCP.check[1] & 0x00ff), (Out->TCP.urg_ptr[0] & 0x0ff) * 256 +
  2937. X        (Out->TCP.urg_ptr[1] & 0x00ff));
  2938. X
  2939. X/*
  2940. X * Display data information
  2941. X */
  2942. X
  2943. X/* 
  2944. X * Data length = Total length - IP header length - TCP Header length
  2945. X */
  2946. Xdlength = (Out->IP.tot_len[0] & 0x00ff) * 256 + (Out->IP.tot_len[1] & 0x00ff)
  2947. X          - (Out->IP.version & 0x000f) * 4 - ((Out->TCP.flags[0] & 0x00f0) >> 4) * 4;
  2948. X
  2949. Xprintf("Data Length: %d\n", dlength);
  2950. Xif((Out->IP.tot_len[0] & 0x00ff) > PACKET_LENGTH)
  2951. X    dlength = PACKET_LENGTH - (Out->IP.version & 0x00ff) * 4 - 
  2952. X              ((Out->TCP.flags[0] & 0x00ff) >> 4) * 4;
  2953. Xprintf("-------------------------------------------------------------\n");
  2954. Xfor(i = 0 + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4;
  2955. X        i <  (dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4);
  2956. X        i += 16)
  2957. X    {
  2958. X    if((dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4) - i >= 16)
  2959. X        for(k = 0; k < 16; k++)
  2960. X            if((Out->DATA[i + k] & 0x00ff) < 16)
  2961. X                printf("0%x", Out->DATA[i + k] & 0x00ff);
  2962. X            else
  2963. X                printf("%x", Out->DATA[i + k] & 0x00ff);
  2964. X    else
  2965. X        for(k = 0; k < (dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4) - i; k++)
  2966. X            if((Out->DATA[i + k] & 0x00ff) < 16)
  2967. X                printf("0%x", Out->DATA[i + k] & 0x00ff);
  2968. X            else
  2969. X                printf("%x", Out->DATA[i + k] & 0x00ff);
  2970. X    printf("                "); 
  2971. X    if((dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4) - i >= 16)
  2972. X        for(k = 0; k < 16; k++)
  2973. X            if((Out->DATA[i + k] & 0x00ff) > 39)
  2974. X                printf("%c", Out->DATA[i + k]);
  2975. X            else
  2976. X                printf("."); 
  2977. X    else
  2978. X        for(k = 0; k < (dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4) - i; k++)
  2979. X            if((Out->DATA[i + k] & 0x00ff) > 39)
  2980. X                printf("%c", Out->DATA[i + k]);
  2981. X            else
  2982. X                printf("."); 
  2983. X    printf("\n");
  2984. X    }
  2985. Xprintf("-------------------------------------------------------------\n");
  2986. X}
  2987. X
  2988. Xint Unique(struct CONNECTION List[256], struct PACKET * Out, int count)
  2989. X{
  2990. Xint i,j;    /* Loop counters */
  2991. Xint flag = -1;
  2992. Xint num;    /* Number where non uniqueness occurs */
  2993. X
  2994. X/*
  2995. X * Scan through list of connections and see if Out differs.
  2996. X */
  2997. Xfor(i = 0; i < count; i++)
  2998. X    {
  2999. X    /*
  3000. X     * Checks if this is a non-unique connection 
  3001. X     */
  3002. X    if((Out->IP.protocol & 0x00ff) == (List[i].protocol & 0x00ff))
  3003. X    if((Out->IP.saddr[0] & 0x00ff) == (List[i].saddr[0] & 0x00ff)) 
  3004. X    if((Out->IP.saddr[1] & 0x00ff) == (List[i].saddr[1] & 0x00ff))
  3005. X    if((Out->IP.saddr[2] & 0x00ff) == (List[i].saddr[2] & 0x00ff))
  3006. X    if((Out->IP.saddr[3] & 0x00ff) == (List[i].saddr[3] & 0x00ff)) 
  3007. X    if((Out->IP.daddr[0] & 0x00ff) == (List[i].daddr[0] & 0x00ff)) 
  3008. X    if((Out->IP.daddr[1] & 0x00ff) == (List[i].daddr[1] & 0x00ff)) 
  3009. X    if((Out->IP.daddr[2] & 0x00ff) == (List[i].daddr[2] & 0x00ff)) 
  3010. X    if((Out->IP.daddr[3] & 0x00ff) == (List[i].daddr[3] & 0x00ff)) 
  3011. X    if((Out->TCP.source[0] & 0x00ff) == (List[i].source[0] & 0x00ff))
  3012. X    if((Out->TCP.source[1] & 0x00ff) == (List[i].source[1] & 0x00ff)) 
  3013. X    if((Out->TCP.dest[0] & 0x00ff) == (List[i].dest[0] & 0x00ff))
  3014. X    if((Out->TCP.dest[1] & 0x00ff) == (List[i].dest[1] & 0x00ff))
  3015. X        flag = i;
  3016. X    }
  3017. X
  3018. Xif (flag == -1)
  3019. X    {
  3020. X    List[count].protocol = Out->IP.protocol;
  3021. X    List[count].saddr[0] = Out->IP.saddr[0];
  3022. X    List[count].saddr[1] = Out->IP.saddr[1];
  3023. X    List[count].saddr[2] = Out->IP.saddr[2];
  3024. X    List[count].saddr[3] = Out->IP.saddr[3];
  3025. X    List[count].daddr[0] = Out->IP.daddr[0];
  3026. X    List[count].daddr[1] = Out->IP.daddr[1];
  3027. X    List[count].daddr[2] = Out->IP.daddr[2];
  3028. X    List[count].daddr[3] = Out->IP.daddr[3];
  3029. X    List[count].source[0] = Out->TCP.source[0];
  3030. X    List[count].source[1] = Out->TCP.source[1];
  3031. X    List[count].dest[0] = Out->TCP.dest[0];
  3032. X    List[count].dest[1] = Out->TCP.dest[1];
  3033. X    List[count].seq[0] = Out->TCP.seq[0];
  3034. X    List[count].seq[1] = Out->TCP.seq[1];
  3035. X    List[count].seq[2] = Out->TCP.seq[2];
  3036. X    List[count].seq[3] = Out->TCP.seq[3];
  3037. X    List[count].ack_seq[0] = Out->TCP.ack_seq[0];
  3038. X    List[count].ack_seq[1] = Out->TCP.ack_seq[1];
  3039. X    List[count].ack_seq[2] = Out->TCP.ack_seq[2];
  3040. X    List[count].ack_seq[3] = Out->TCP.ack_seq[3];
  3041. X    }
  3042. X
  3043. Xreturn flag;
  3044. X}
  3045. X
  3046. X/*
  3047. X * Display unique connections
  3048. X */
  3049. X
  3050. Xvoid Display_Connections(struct CONNECTION List[256], int count)
  3051. X{
  3052. Xint i;
  3053. X
  3054. Xfor(i = 0; i < count; i++)
  3055. X    {
  3056. X    printf("#%d, P: %d, ", i, List[i].protocol & 0x00ff);
  3057. X    printf("SA: %d.%d.%d.%d, DA: %d.%d.%d.%d, ",
  3058. X        List[i].saddr[0] & 0x00ff, List[i].saddr[1] & 0x00ff, 
  3059. X        List[i].saddr[2] & 0x00ff, List[i].saddr[3] & 0x00ff, 
  3060. X        List[i].daddr[0] & 0x00ff, List[i].daddr[1] & 0x00ff, 
  3061. X        List[i].daddr[2] & 0x00ff, List[i].daddr[3] & 0x00ff); 
  3062. X    printf("SP: %d, DP: %d\n",
  3063. X        (List[i].source[0] & 0x00ff) * 256 + (List[i].source[1] & 0x00ff),
  3064. X        (List[i].dest[0] & 0x00ff) * 256 + (List[i].dest[1] & 0x00ff));
  3065. X    }
  3066. Xprintf("---------------------------------------------------------\n");
  3067. X}
  3068. X
  3069. Xvoid Set_Connection(struct PACKET * Out, struct CONNECTION List[256])
  3070. X    {   
  3071. X    List[0].protocol = Out->IP.protocol;
  3072. X    List[0].saddr[0] = Out->IP.saddr[0];
  3073. X    List[0].saddr[1] = Out->IP.saddr[1];
  3074. X    List[0].saddr[2] = Out->IP.saddr[2];
  3075. X    List[0].saddr[3] = Out->IP.saddr[3];
  3076. X    List[0].daddr[0] = Out->IP.daddr[0];
  3077. X    List[0].daddr[1] = Out->IP.daddr[1];
  3078. X    List[0].daddr[2] = Out->IP.daddr[2];
  3079. X    List[0].daddr[3] = Out->IP.daddr[3];
  3080. X    List[0].source[0] = Out->TCP.source[0];
  3081. X    List[0].source[1] = Out->TCP.source[1];
  3082. X    List[0].dest[0] = Out->TCP.dest[0];
  3083. X    List[0].dest[1] = Out->TCP.dest[1];
  3084. X    List[0].seq[0] = Out->TCP.seq[0];
  3085. X    List[0].seq[1] = Out->TCP.seq[1];
  3086. X    List[0].seq[2] = Out->TCP.seq[2];
  3087. X    List[0].seq[3] = Out->TCP.seq[3];
  3088. X    List[0].ack_seq[0] = Out->TCP.ack_seq[0];
  3089. X    List[0].ack_seq[1] = Out->TCP.ack_seq[1];
  3090. X    List[0].ack_seq[2] = Out->TCP.ack_seq[2];
  3091. X    List[0].ack_seq[3] = Out->TCP.ack_seq[3];
  3092. X    }
  3093. X
  3094. Xint Data_Length(struct PACKET *Out)
  3095. X{
  3096. Xreturn (Out->IP.tot_len[0] & 0x00ff) * 256 + (Out->IP.tot_len[1] & 0x00ff)
  3097. X       - (Out->IP.version & 0x000f) * 4 - ((Out->TCP.flags[0] & 0x00f0) >> 4)
  3098. X       * 4;
  3099. X}
  3100. X
  3101. Xvoid Write_Data(struct PACKET * Out)
  3102. X{
  3103. Xint dlength;
  3104. Xint i, k;
  3105. X
  3106. X/* 
  3107. X * Data length = Total length - IP header length - TCP Header length
  3108. X */
  3109. Xdlength = (Out->IP.tot_len[0] & 0x00ff) * 256 + (Out->IP.tot_len[1] & 0x00ff)
  3110. X          - (Out->IP.version & 0x000f) * 4 - ((Out->TCP.flags[0] & 0x00f0) >> 4) * 4;
  3111. Xfor(i = 0 + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4;
  3112. X        i <  (dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4);
  3113. X        i += 16)
  3114. X    {
  3115. X    if((dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4) - i >= 16)
  3116. X        for(k = 0; k < 16; k++)
  3117. X            if((Out->DATA[i + k] & 0x00ff) > 39)
  3118. X                printf("%c", Out->DATA[i + k]);
  3119. X            else
  3120. X                printf("."); 
  3121. X    else
  3122. X        for(k = 0; k < (dlength + (((Out->TCP.flags[0] & 0x00f0) >> 4) - 5) * 4) - i; k++)
  3123. X            if((Out->DATA[i + k] & 0x00ff) > 39)
  3124. X                printf("%c", Out->DATA[i + k]);
  3125. X            else
  3126. X                printf("."); 
  3127. X    }
  3128. X}
  3129. X
  3130. X
  3131. SHAR_EOF
  3132. chmod 0644 sniff.c || echo "restore of sniff.c fails"
  3133. sed 's/^X//' << 'SHAR_EOF' > sniff.h &&
  3134. X#include "packet.h"
  3135. X
  3136. X/*
  3137. X * Header file for sniff functions
  3138. X */
  3139. X
  3140. Xvoid init(char *);
  3141. X
  3142. Xvoid Get_Packet(char buf[PACKET_LENGTH]);
  3143. X
  3144. Xstruct PACKET * Convert_Packet(char *);
  3145. X
  3146. Xvoid Display_Packet(struct PACKET *);
  3147. X
  3148. Xint Unique(struct CONNECTION *, struct PACKET *, int);
  3149. X
  3150. Xvoid Set_Connection(struct PACKET *, struct CONNECTION *);
  3151. X
  3152. Xvoid Write_Data(struct PACKET *);
  3153. X
  3154. Xvoid Display_Connections(struct CONNECTION *, int);
  3155. X
  3156. Xint Data_Length(struct PACKET *);
  3157. X
  3158. SHAR_EOF
  3159. chmod 0644 sniff.h || echo "restore of sniff.h fails"
  3160. exit 0
  3161.  
  3162.  
  3163.  
  3164.  
  3165.                   .oO____Oo.
  3166.  
  3167.  
  3168. -----------------------------------------------------
  3169. -       Mythrandir's Phone explorations             -
  3170. -----------------------------------------------------
  3171.  
  3172.     A short time ago I began to realize that I had no idea how
  3173. the phone system worked.  Now most people could care less about this.
  3174. But I can never understand people like that.  Well I went out
  3175. and printed out the old LOD/H tech journals and poured through the
  3176. information they had on the telephone system.
  3177.     I also found an excellent little book called Ready-to-Build Telephone enhancements by
  3178. Delton T. Horn ISBN:0-8306-4359-1  The other surprising resource that I found
  3179. was from good ole AT&T herself.. http://www.att.com/TALKINGPOWER/ (I believe
  3180. it is) is a series of documents written by the people who make the giant
  3181. backup batteries for the phone system.  While there are several pages
  3182. on how they create them, there are several other excellent pages which
  3183. very clearly explain the basic operations of the phone system.  So simple in
  3184. fact, that they have inspired me to build a very small but workable
  3185. telephone system myself (switching and all) just to learn about it some more.
  3186.     So, the  following are a few interesting circuits that I have found
  3187. during my exploits that I thought I would share with you.  
  3188.    
  3189.  
  3190.     ----------------
  3191.     - Basic Info   -
  3192.     ----------------
  3193.  
  3194. **WIRES**
  3195.  
  3196. The four standard wires in a phone line are as follows
  3197. (In order to see these, rip off the jacket on one of your phone cords)
  3198.  
  3199. red - This is the tip wire.  
  3200. green - This is the ring wire. The tip and the ring form the loop
  3201.     between your house and the CO (central office).
  3202. yellow - This wire carries the ringer signal.  However, in most home
  3203.      phone systems this wire is shorted to the green wire.
  3204.      So if you want to disable the ringer without 
  3205. black - Usually unused, but sometimes used in multiline systems.
  3206.     I don't know the specific use as I have yet to tinker with anything
  3207.     but my home line. Though I would guess that it is used in 
  3208.     conferencing type systems and such. 
  3209.  
  3210. **TONES**
  3211.  
  3212. The phone company uses dual tones for all of its services.  The reason
  3213. for this as it is incredibly unlikely for a dual tone to be created 
  3214. naturally.  So what is a dual tone? Why simply two different tones signaled
  3215. at once.
  3216.  
  3217. Name            Frequency               Duration
  3218.  
  3219. Dial Tone       350Hz & 440Hz           Continuous
  3220. Busy Signal     480Hz & 620Hz           .5sec on, .5 sec off.. and so on
  3221. Ring Back       440Hz & 480Hz           2sec on, 4 sec off
  3222. PBX             440Hz & 480Hz           1sec on, 3 sec off
  3223. Off Hook        1400Hz & 2060Hz &       .1sec on, .1sec off (yes this is 
  3224.         2450Hz & 2600Hz                                annoying) 
  3225. No such number  200Hz & 400Hz           Continous sweep at 1Hz
  3226.  
  3227. **Dual Tone MultiFrequency(DTMF) TONES**
  3228.         Column1         Column2         Column3         Column4
  3229.         1209Hz          1336Hz          1336Hz          1477Hz
  3230.  
  3231. Row1 697Hz        1               2               3               A
  3232.  
  3233. Row2 770Hz        4               5               6               B
  3234.  
  3235. Row3 852Hz        7               8               9               C
  3236.  
  3237. Row4 941Hz        *               0               #               D
  3238.  
  3239. ABCD are often used by the military for priority overides.  e.g. Flash
  3240.  
  3241. ------------
  3242. - Circuits -
  3243. ------------
  3244.  
  3245.     This first one is from LOD/H Volume 1 Issue 1, in an article entitled
  3246. Outside Loop Distribution Plant.  The circuit allows you to create a test set.
  3247. It has two modes, one is normal line operation, and the other is a "listen"
  3248. mode.  
  3249.  
  3250. The schematic is as follows:
  3251.  
  3252. Ring >-------------------------------------> To test phone
  3253.  
  3254. Tip >-------| SPST Switch  |---------------> To test phone
  3255.         |              |
  3256.         |--/\/\/\/\----|
  3257.         |    Resistor  |
  3258.         |----|(--------|
  3259.         Capacitor
  3260.  
  3261. The capacitor should roughly be a .22uF 200 WVDC Mylar capacitor.
  3262. I got away with two .10 micro farads in parallel. (cap's in || are additive)
  3263.  
  3264. The resistor should be a 10kOhm 1/2W resistor.
  3265. For me this did not work.  I had to throw two 10k's in || and drop the
  3266. resistance to 5kOhm in order to be able to listen into the line.  Otherwise
  3267. I was unable to get any audio.
  3268.  
  3269. >--- should be alligator clips that can connect to posts.  Also you make them
  3270.      wires leading out of a phone jack as well.  In any case, the simply
  3271.      need to be able to connect to the ring and tip of a line in whatever
  3272.      manner is needed by you.
  3273.  
  3274. The SPST Switch is used to break the tip connection to the test phone.
  3275. If the switch is closed then the current will flow straight through the
  3276. wire and bypass the resistor and capacitor.  This will cause the phone
  3277. to act like a normal phone.  If the switch is open the Capacitor will charge
  3278. and block the DC voltage on the line. This will keep the phone companies
  3279. switch from detecting an off hook from current flow.  However, since the
  3280. audio signal sent across the wire is an AC signal, you will still be
  3281. able to here it.  This is because the capacitor does not block AC signals.
  3282. (If you are not sure why, please read up on it in a basic electronics
  3283. circuitry book).
  3284.  
  3285.  
  3286. The other circuit that interested me is a DTMF dialer.  I am only using
  3287. a small portion of it for myself.  I merely added the ABCD buttons to
  3288. my phone, as well as the test set above.  I used a one piece flip phone
  3289. that is very convenient as it has no base and is easy to carry around.
  3290.  
  3291.  
  3292. The parts you will need are as follows
  3293.  
  3294. IC1     MK5085 DTMF generator
  3295. IC2     LM380  Audio amplifier
  3296. KB      a 16 Button Pad. You can use a twelve as well, but you will
  3297.     not have ABCD then..
  3298. CR      3.58MHz crystal
  3299. C1      10uF 25V electrolytic capacitor
  3300. C2      .01uF cap
  3301. C3      47uF 25V electrolytic capacitor
  3302. R1      10kOhm 1/4W 5% tolerance resistor
  3303. R2      1kOhm   1/4W 5%
  3304. R3      1kOhm   1/4W 5%
  3305. R4      100Ohm Pot
  3306. SP      8Ohm Speaker.
  3307.  
  3308.                        +9V
  3309.                     |
  3310.                  -------------
  3311.      |---------------------------|3 8 7 1    |
  3312.      | |-------------------------|4        10|
  3313.      | | |-----------------------|5          |
  3314.      | | | ----------------------|9  IC1     |
  3315.      | | | |                     |           |
  3316.     ---------                    |           |
  3317.     |1 2 3 A|--------------------|14         |
  3318.     |  KB   |--------------------|13         |
  3319.     |       |--------------------|12         |
  3320.     |* 0 # D|--------------------|11  6   16 |
  3321.     ---------                    -------------
  3322.                       |    |
  3323.                      gnd   |
  3324.                      R2    |   R3     C2
  3325.                 --/\/\/\/\-|-/\/\/\/\-|(--
  3326.                 |                        |
  3327.                 |                        |
  3328.                    gnd            ------------
  3329.                           |
  3330.                           |      +12V
  3331.                     ------|       |
  3332.                     |     |     |\|
  3333.                     |---/\/\/\--|+ \    C3
  3334.                     |    R4     |IC2 >--)|--|
  3335.                     |-----------|- /        |< SP
  3336.                             |/|         |
  3337.                               |         |
  3338.                              gnd       gnd
  3339.  
  3340. In order to you use only one power source for both +12v and +9v
  3341. just construct a voltage divder. Send +12 to the OpAmp and +12 to the
  3342. diveder which will have a +9V output.
  3343.  
  3344.          22kOhm     68kOhm     
  3345.      +12V(in)---/\/\/\/\---/\/\/\/\--gnd
  3346.              |
  3347.              |
  3348.             Out (+9V)
  3349.        
  3350.  
  3351.  
  3352.                   .oO____Oo.
  3353.  
  3354.